tests/tap_runner: intercept stderr as TAP diagnostic lines#20
Draft
tests/tap_runner: intercept stderr as TAP diagnostic lines#20
Conversation
Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/e2a4da2b-f717-40d3-b6ac-5da0c88fb18e Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update TAP runner to intercept stderr as TAP diagnostics
tests/tap_runner: intercept stderr as TAP diagnostic lines
Apr 7, 2026
…stics Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/0ac3f6cb-9e6e-4b6d-8bb6-da68c04596b8 Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/35c2a08f-97fa-4624-b430-e9757f6831ea Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/96feac4c-99d6-439d-934f-2a3c8af78195 Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/aa08b21e-e8ef-481b-8625-bdda1970cdbe Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/7ae055d8-4c72-40a1-bd86-f23660b6c0bb Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
Instead of redirecting sys.stdout to real_stderr (which mixes logging with error output), introduce TAPDiagnosticStream that prefixes every print() line with '# ' and writes it to real_stdout. This keeps diagnostic logging on stdout as TAP-compliant diagnostic lines, while error/failure tracebacks continue to go to stderr. Resulting output: stdout: TAP version 13 / plan / # diagnostics / ok|not ok lines stderr: error tracebacks only Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/bfd8b019-7cb6-45ff-bf10-301d962076e4 Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TAPDiagnosticStreamclass that prefixes each line with#and writes to real_stdoutsys.stdout = real_stderrwithsys.stdout = TAPDiagnosticStream(real_stdout)so print() output goes to stdout as TAP diagnostic linesOriginal prompt
This pull request was created from Copilot chat.