bpo-40275: Use new test.support helper submodules in tests (GH-21727)

This commit is contained in:
Hai Shi 2020-08-04 23:53:12 +08:00 committed by GitHub
parent 604bba1f8f
commit c7decc27d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 58 additions and 46 deletions

View file

@ -8,7 +8,7 @@ tests of their own.
import os
import sys
import unittest
from test import support
from test.support import import_helper
from test.test_tools import scriptsdir, import_tool, skip_if_missing
@ -30,7 +30,7 @@ class TestSundryScripts(unittest.TestCase):
skiplist = blacklist + whitelist + windows_only + other
def test_sundry(self):
old_modules = support.modules_setup()
old_modules = import_helper.modules_setup()
try:
for fn in os.listdir(scriptsdir):
if not fn.endswith('.py'):
@ -43,7 +43,7 @@ class TestSundryScripts(unittest.TestCase):
import_tool(name)
finally:
# Unload all modules loaded in this test
support.modules_cleanup(*old_modules)
import_helper.modules_cleanup(*old_modules)
@unittest.skipIf(sys.platform != "win32", "Windows-only test")
def test_sundry_windows(self):