8000 test_capi.test__testcapi() becomes more verbose (#4197) · ultimatecoder/cpython@e1a470b · GitHub
[go: up one dir, main page]

Skip to content

Commit e1a470b

Browse files
authored
test_capi.test__testcapi() becomes more verbose (python#4197)
Write the name of each subtest on a new line to help debugging when a test does crash Python.
1 parent db91e0f commit e1a470b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Lib/test/test_capi.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,16 @@ def callback():
751751

752752
class Test_testcapi(unittest.TestCase):
753753
def test__testcapi(self):
754+
if support.verbose:
755+
print()
754756
for name in dir(_testcapi):
755-
if name.startswith('test_'):
756-
with self.subTest("internal", name=name):
757-
test = getattr(_testcapi, name)
758-
test()
757+
if not name.startswith('test_'):
758+
continue
759+
with self.subTest("internal", name=name):
760+
if support.verbose:
761+
print(f" {name}", flush=True)
762+
test = getattr(_testcapi, name)
763+
test()
759764

760765

761766
class PyMemDebugTests(unittest.TestCase):

0 commit comments

Comments
 (0)
0