summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unittest
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_unittest')
-rw-r--r--Lib/test/test_unittest/test_discovery.py5
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),