Avoid replacing existing modules and sys.path in import tests
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index f4a1649..1e62940 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -43,16 +43,19 @@
reload()."""
def test_source(self):
- import os
- imp.reload(os)
+ with test_support.CleanImport('os'):
+ import os
+ imp.reload(os)
def test_extension(self):
- import time
- imp.reload(time)
+ with test_support.CleanImport('time'):
+ import time
+ imp.reload(time)
def test_builtin(self):
- import marshal
- imp.reload(marshal)
+ with test_support.CleanImport('marshal'):
+ import marshal
+ imp.reload(marshal)
def test_main():