-
Notifications
You must be signed in to change notification settings - Fork 30
Support raw yaml block in tracker #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…appy into supprt-raw-yaml-block
for more information, see https://pre-commit.ci
…appy into supprt-raw-yaml-block
for more information, see https://pre-commit.ci
…appy into supprt-raw-yaml-block
for more information, see https://pre-commit.ci
mblayman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking pretty good. Thanks! I have a couple of minor comments before I'm ready to merge.
src/tap/line.py
Outdated
| indented_yaml_block = "\n".join( | ||
| f"{indent}{line}" for line in self._yaml_block.splitlines() | ||
| ) | ||
| yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking... should there be a trailing newline here? I suspect the answer is no because is probably printed later, but I would hate to mistakenly combine test line like <end of yaml>...not ok 43 yada yada
| yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..." | |
| yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}...\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No newline needed here. in Tracker.generate_tap_report it calls print for each Line object. a Result is still a "Line" (even though it's actually multi-line).
def generate_tap_report(self, test_case, tap_lines, out_file):
self._write_test_case_header(test_case, out_file)
for tap_line in tap_lines:
print(tap_line, file=out_file)
Plus for reassurance, you can see that even if there was no yaml block added, diagnostics in this method did not have a trailing newline either
Improve support for YAML blocks: