mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Factor out common boilerplate for test_support
This commit is contained in:
parent
c23fb77477
commit
9dcbbea878
4 changed files with 14 additions and 24 deletions
|
|
@ -9,7 +9,7 @@ import warnings
|
|||
warnings.filterwarnings("ignore", "tempnam", RuntimeWarning, __name__)
|
||||
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, __name__)
|
||||
|
||||
from test.test_support import TESTFN, run_suite
|
||||
from test.test_support import TESTFN, run_classtests
|
||||
|
||||
class TemporaryFileTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
@ -282,14 +282,10 @@ class WalkTests(unittest.TestCase):
|
|||
os.rmdir(TESTFN)
|
||||
|
||||
def test_main():
|
||||
suite = unittest.TestSuite()
|
||||
for cls in (TemporaryFileTests,
|
||||
StatAttributeTests,
|
||||
EnvironTests,
|
||||
WalkTests,
|
||||
):
|
||||
suite.addTest(unittest.makeSuite(cls))
|
||||
run_suite(suite)
|
||||
run_classtests(TemporaryFileTests,
|
||||
StatAttributeTests,
|
||||
EnvironTests,
|
||||
WalkTests)
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue