You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
subtests: inconcistent handling of non-string messages #14195
a detailed description of the bug or problem you are having
output of pip list from the virtual environment you are using
pytest and operating system versions
minimal example if possible
pytest: 9.0.2
operating system: any
When calling self.subTest(msg) with a non-string msg, the message is not printed when run via pytest.
In contrast, it is printed when run with unittest.
It is also printed when using the subtests fixture in a pytest test.
Example:
import unittest
class T(unittest.TestCase):
def test_int_msg(self):
with self.subTest(42):
assert False, "subtest failure"
if __name__ == '__main__':
unittest.main()
Run with unittest - message is printed:
FAIL: test_int_msg (__main__.T.test_int_msg) [42]
Run with pytest - message is replaced with <subtest>:
Activity
subtests: fix inconcistent handling of non-string messages (#14196)
subtests: fix inconcistent handling of non-string messages (pytest-de…
subtests: fix inconcistent handling of non-string messages (#14196) (#…
build(security): Update dependency pytest to v9.0.3 [SECURITY] (#217)
chore(deps): update root dev dependencies (patch)
🔒️ Update dependency pytest to v9 [SECURITY] (#16)
[SECURITY] Update dependency pytest to v9 [SECURITY] (#2)
Update dependency pytest to v9 (#35)