diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-09-05 18:57:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-05 18:57:48 (GMT) |
commit | 3f89b257639dd817a32079da2ae2c4436b8e82eb (patch) | |
tree | 1569d6dfb9e4ad31e7e1c41a4c15e6c8ca1e11a4 /Lib/test/test_unittest | |
parent | deea7c82682848b2a0db971a4dcc3a32c73a9f8c (diff) | |
download | cpython-3f89b257639dd817a32079da2ae2c4436b8e82eb.zip cpython-3f89b257639dd817a32079da2ae2c4436b8e82eb.tar.gz cpython-3f89b257639dd817a32079da2ae2c4436b8e82eb.tar.bz2 |
gh-108927: Fix test_import + test_importlib + test_unittest problem (#108929)
Diffstat (limited to 'Lib/test/test_unittest')
-rw-r--r-- | Lib/test/test_unittest/test_discovery.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_unittest/test_discovery.py b/Lib/test/test_unittest/test_discovery.py index 946fa12..004898e 100644 --- a/Lib/test/test_unittest/test_discovery.py +++ b/Lib/test/test_unittest/test_discovery.py @@ -6,7 +6,6 @@ import types import pickle from test import support from test.support import import_helper -import test.test_importlib.util import unittest import unittest.mock @@ -826,6 +825,8 @@ class TestDiscovery(unittest.TestCase): 'as dotted module names') def test_discovery_failed_discovery(self): + from test.test_importlib import util + loader = unittest.TestLoader() package = types.ModuleType('package') @@ -837,7 +838,7 @@ class TestDiscovery(unittest.TestCase): # Since loader.discover() can modify sys.path, restore it when done. with import_helper.DirsOnSysPath(): # Make sure to remove 'package' from sys.modules when done. - with test.test_importlib.util.uncache('package'): + with util.uncache('package'): with self.assertRaises(TypeError) as cm: loader.discover('package') self.assertEqual(str(cm.exception), |