Skip to content

subtests: fix inconcistent handling of non-string messages#14196

Merged
nicoddemus merged 4 commits intopytest-dev:mainfrom
radoering:subtests-non-string-message
Feb 16, 2026
Merged

subtests: fix inconcistent handling of non-string messages#14196
nicoddemus merged 4 commits intopytest-dev:mainfrom
radoering:subtests-non-string-message

Conversation

@radoering
Copy link
Contributor

Resolves: #14195

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Feb 15, 2026
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but both tests pass on main, so they are not really testing the issue.

@radoering
Copy link
Contributor Author

Thanks, but both tests pass on main, so they are not really testing the issue.

How is this possible? I tested locally that the second test fails before creating the PR. I reverted the fix for now and you can see that the second test fails in CI. My branch should be up to date with main.

The first test passes without the change. I only created it as regression test for the symmetry between the subtests fixture and unittest.TestCase.subTest.

@nicoddemus
Copy link
Member

@radoering terribly sorry, you are right, I just tried the tests again with main and indeed the unittest one fails. I must have messed something up on my local testing, sorry about that.

@nicoddemus nicoddemus force-pushed the subtests-non-string-message branch from fe30f4c to f2be8d4 Compare February 16, 2026 14:27
@nicoddemus nicoddemus enabled auto-merge (squash) February 16, 2026 14:37
@nicoddemus nicoddemus added the backport 9.0.x apply to PRs at any point; backports the changes to the 9.0.x branch label Feb 16, 2026
@nicoddemus nicoddemus merged commit 8950ca3 into pytest-dev:main Feb 16, 2026
33 checks passed
@patchback
Copy link

patchback bot commented Feb 16, 2026

Backport to 9.0.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/9.0.x/8950ca3bc0988647dfc35b02f854347a1435bd36/pr-14196

Backported as #14199

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Feb 16, 2026
Fixes #14195

---------

Co-authored-by: Bruno Oliveira <bruno@pytest.org>
(cherry picked from commit 8950ca3)
nicoddemus added a commit that referenced this pull request Feb 16, 2026
…14199)

Fixes #14195

---------


(cherry picked from commit 8950ca3)

Co-authored-by: Randy Döring <30527984+radoering@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <bruno@pytest.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 9.0.x apply to PRs at any point; backports the changes to the 9.0.x branch bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

subtests: inconcistent handling of non-string messages

2 participants