summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-11-12 04:59:23 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-11-12 04:59:23 (GMT)
commitdfcd69467489b940232adb5c82dd91aab4a25406 (patch)
tree0e7173251c63471ab5dd0c3351b4158e9f1dd8a7 /Lib
parent8f56bf57fd670a6f45baf812c77eae5960a95cfd (diff)
parentc12f09ed24db31f0fc0b58010cb3da9e3107e06c (diff)
downloadcpython-dfcd69467489b940232adb5c82dd91aab4a25406.zip
cpython-dfcd69467489b940232adb5c82dd91aab4a25406.tar.gz
cpython-dfcd69467489b940232adb5c82dd91aab4a25406.tar.bz2
Issue #19440: Clean up test_capi
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_capi.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 2ef5d4a..d37c057 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -1,7 +1,6 @@
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
-from __future__ import with_statement
import os
import pickle
import random
@@ -416,18 +415,13 @@ class TestThreadState(unittest.TestCase):
t.start()
t.join()
-
-def test_main():
- support.run_unittest(CAPITest, TestPendingCalls, Test6012,
- EmbeddingTests, SkipitemTest, TestThreadState,
- SubinterpreterTest)
-
- for name in dir(_testcapi):
- if name.startswith('test_'):
- test = getattr(_testcapi, name)
- if support.verbose:
- print("internal", name)
- test()
+class Test_testcapi(unittest.TestCase):
+ def test__testcapi(self):
+ for name in dir(_testcapi):
+ if name.startswith('test_'):
+ with self.subTest("internal", name=name):
+ test = getattr(_testcapi, name)
+ test()
if __name__ == "__main__":
- test_main()
+ unittest.main()