aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_pkg.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pkg.py')
-rw-r--r--Lib/test/test_pkg.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py
index 1e32d2c2bb2..fde99dc4ff9 100644
--- a/Lib/test/test_pkg.py
+++ b/Lib/test/test_pkg.py
@@ -43,14 +43,18 @@ def fixdir(lst):
# from package import * (defined in __init__)
-class Test(unittest.TestCase):
+class TestPkg(unittest.TestCase):
def setUp(self):
self.root = None
self.syspath = list(sys.path)
+ self.sysmodules = sys.modules.copy()
def tearDown(self):
sys.path[:] = self.syspath
+ sys.modules.clear()
+ sys.modules.update(self.sysmodules)
+ del self.sysmodules
cleanout(self.root)
def run_code(self, code):