Skip to content

Fix subTest reporting - #647

Merged
jelmer merged 3 commits into
testing-cabal:masterfrom
stephenfin:issue-646
Nov 30, 2026
Merged

jelmer merged 3 commits into
testing-cabal:masterfrom
stephenfin:issue-646

Conversation

@stephenfin

@stephenfin stephenfin commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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.

Fixes #646.

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
jelmer merged commit f23adb4 into testing-cabal:master Nov 30, 2026
9 checks passed
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.

subTest reporting broken

2 participants