Skip to content

Add support for unittest.TestCase.subTest#567

Merged
jelmer merged 1 commit intotesting-cabal:masterfrom
stephenfin:subtest-support
Feb 17, 2026
Merged

Add support for unittest.TestCase.subTest#567
jelmer merged 1 commit intotesting-cabal:masterfrom
stephenfin:subtest-support

Conversation

@stephenfin
Copy link
Contributor

@stephenfin stephenfin commented Feb 17, 2026

This has been supported since Python 3.4 [1]. Like the stdlib implementation, we report failures individually but treat the entire method as a single "test" (so multiple failures in a single test method will still result in a Failed: 1 summary).

[1] https://docs.python.org/3/library/unittest.html#distinguishing-test-iterations-using-subtests

@stephenfin stephenfin force-pushed the subtest-support branch 2 times, most recently from a2748f6 to 8810f4a Compare February 17, 2026 17:23
This has been supported since Python 3.4 [1]. Like the stdlib
implementation, we report failures individually but still treat the
entire method as a single "test" (so multiple failures in a single test
method will still result in e.g. a `Failed: 1` summary).

[1] https://docs.python.org/3/library/unittest.html#distinguishing-test-iterations-using-subtests

Signed-off-by: Stephen Finucane <stephen@that.guru>
@jelmer jelmer merged commit 3e72721 into testing-cabal:master Feb 17, 2026
9 checks passed
@stephenfin stephenfin deleted the subtest-support branch February 17, 2026 23:33
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

Comments