File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Run the _testcapi module tests (tests for the Python/C API): by defn,
22# these are all functions _testcapi exports whose name begins with 'test_'.
33
4- from __future__ import with_statement
54import os
65import pickle
76import random
@@ -351,17 +350,12 @@ def callback():
351350 t .start ()
352351 t .join ()
353352
354-
355- def test_main ():
356- support .run_unittest (CAPITest , TestPendingCalls , Test6012 ,
357- EmbeddingTest , SkipitemTest , TestThreadState )
358-
359- for name in dir (_testcapi ):
360- if name .startswith ('test_' ):
361- test = getattr (_testcapi , name )
362- if support .verbose :
363- print ("internal" , name )
364- test ()
353+ class Test_testcapi (unittest .TestCase ):
354+ def test__testcapi (self ):
355+ for name in dir (_testcapi ):
356+ if name .startswith ('test_' ):
357+ test = getattr (_testcapi , name )
358+ test ()
365359
366360if __name__ == "__main__" :
367- test_main ()
361+ unittest . main ()
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ Library
4242Tests
4343-----
4444
45+ - Issue #19440: Clean up test_capi by removing an unnecessary __future__
46+ import, converting from test_main to unittest.main, and running the
47+ _testcapi module tests within a unittest TestCase.
48+
4549- Issue #18702: All skipped tests now reported as skipped.
4650
4751- Issue #19085: Added basic tests for all tkinter widget options.
You can’t perform that action at this time.
0 commit comments