Skip to content

Conversation

@codambro
Copy link
Contributor

@codambro codambro commented Dec 3, 2025

Improve support for YAML blocks:

  • Allowing passing raw_yaml_block to tracker when adding test result
  • Output YAML block in generated TAP file
  • Is your name/identity in the AUTHORS file?
  • Does the code change (if the PR contains code) have 100% test coverage?
  • Is CI passing all quality and testing checks?

Copy link
Member

@mblayman mblayman left a 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}..."
Copy link
Member

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

Suggested change
yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}..."
yaml_block = f"\n{indent}---\n{indented_yaml_block}\n{indent}...\n"

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants