Repository navigation
Fix subTest reporting - #647
Merged
Merged
Conversation
This will make a future change easier to grok. Signed-off-by: Stephen Finucane <stephen@that.guru>
Convert exceptions supplied to addSubTest into labelled traceback details when buffering them. This lets stopTest reuse _emit_details and prepares the buffer to accept the details supplied by testtools' exception handlers. Update the attachment assertions to handle streamed traceback chunks. Signed-off-by: Stephen Finucane <stephen@that.guru>
Commit 2e080a8 changed testtools.TestCase subtests to report through the exception handlers rather than addSubTest. The stream adapter suppressed the individual failure statuses without buffering the failures, leaving the parent test in progress. Runners such as stestr consequently reported an unfinished test and zero explicit failures. Buffer these labelled details alongside unittest subtest failures and flush them before emitting the parent's terminal failure status. Also flush the buffer when the parent itself fails, avoiding duplicate results. Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: testing-cabal#646
jelmer
approved these changes
Nov 30, 2026
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.
Commit 2e080a8 changed
testtools.TestCasesubtests to report through the exception handlers rather thanaddSubTest. The stream adapter suppressed the individual failure statuses without buffering the failures, leaving the parent test in progress. Runners such as stestr consequently reported an unfinished test and zero explicit failures.Buffer these labelled details alongside unittest subtest failures and flush them before emitting the parent's terminal failure status. Also flush the buffer when the parent itself fails, avoiding duplicate results.
Fixes #646.