test_capi.test__testcapi() becomes more verbose (#4197)

Write the name of each subtest on a new line to help debugging when
a test does crash Python.
This commit is contained in:
Victor Stinner 2017-10-31 08:40:59 -07:00 committed by GitHub
parent db91e0fe24
commit e1a470bd6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -751,9 +751,14 @@ class TestThreadState(unittest.TestCase):
class Test_testcapi(unittest.TestCase):
def test__testcapi(self):
if support.verbose:
print()
for name in dir(_testcapi):
if name.startswith('test_'):
if not name.startswith('test_'):
continue
with self.subTest("internal", name=name):
if support.verbose:
print(f" {name}", flush=True)
test = getattr(_testcapi, name)
test()