summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_unittest.py')
-rw-r--r--Lib/test/test_unittest.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
index 991740c..10932de 100644
--- a/Lib/test/test_unittest.py
+++ b/Lib/test/test_unittest.py
@@ -6,6 +6,7 @@ Still need testing:
TestCase.{assert,fail}* methods (some are tested implicitly)
"""
+import builtins
import os
import re
import sys
@@ -3389,9 +3390,10 @@ class TestDiscovery(TestCase):
def test_get_module_from_path(self):
loader = unittest.TestLoader()
+ old_import = __import__
def restore_import():
- unittest.__import__ = __import__
- unittest.__import__ = lambda *_: None
+ builtins.__import__ = old_import
+ builtins.__import__ = lambda *_: None
self.addCleanup(restore_import)
expected_module = object()