Commit dfcd6946 authored by Zachary Ware's avatar Zachary Ware

Issue #19440: Clean up test_capi

parents 8f56bf57 c12f09ed
# Run the _testcapi module tests (tests for the Python/C API): by defn, # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'. # these are all functions _testcapi exports whose name begins with 'test_'.
from __future__ import with_statement
import os import os
import pickle import pickle
import random import random
...@@ -416,18 +415,13 @@ class TestThreadState(unittest.TestCase): ...@@ -416,18 +415,13 @@ class TestThreadState(unittest.TestCase):
t.start() t.start()
t.join() t.join()
class Test_testcapi(unittest.TestCase):
def test_main(): def test__testcapi(self):
support.run_unittest(CAPITest, TestPendingCalls, Test6012, for name in dir(_testcapi):
EmbeddingTests, SkipitemTest, TestThreadState, if name.startswith('test_'):
SubinterpreterTest) with self.subTest("internal", name=name):
test = getattr(_testcapi, name)
for name in dir(_testcapi): test()
if name.startswith('test_'):
test = getattr(_testcapi, name)
if support.verbose:
print("internal", name)
test()
if __name__ == "__main__": if __name__ == "__main__":
test_main() unittest.main()
...@@ -213,6 +213,10 @@ Library ...@@ -213,6 +213,10 @@ Library
Tests Tests
----- -----
- Issue #19440: Clean up test_capi by removing an unnecessary __future__
import, converting from test_main to unittest.main, and running the
_testcapi module tests as subTests of a unittest TestCase method.
- Issue #19378: the main dis module tests are now run with both stdout - Issue #19378: the main dis module tests are now run with both stdout
redirection *and* passing an explicit file parameter redirection *and* passing an explicit file parameter
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment