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
When writing a plugin that attempts to capture the subtest report, it was discovered that the subtest report will not be printed unless the -s flag is used while subclassing unittest.TestCase, however it works fine when using pytest fixtures instead.
from unittest import TestCase
class TestFoo(TestCase):
def test_all(self):
with self.subTest('test_foo'):
raise Exception('foo')
with self.subTest('test_bar'):
raise Exception('bar')
def test_baz(subtests):
with subtests.test('test_baz_first'):
raise Exception('first')
with subtests.test('test_baz_second'):
raise Exception('second')
When writing a plugin that attempts to capture the subtest report, it was discovered that the subtest report will not be printed unless the
-s
flag is used while subclassingunittest.TestCase
, however it works fine when using pytest fixtures instead.Would you please make the behavior consistent?
You can reproduce via the following:
conftest.py
test_foo.py
pytest test_foo.py
pytest test_foo.py -s
The text was updated successfully, but these errors were encountered: