Another fix for #1414
This commit is contained in:
parent
f19169f2d5
commit
db4a2ef23a
|
@ -4,7 +4,6 @@ from __future__ import with_statement
|
||||||
from test.test_support import captured_stdout, run_unittest
|
from test.test_support import captured_stdout, run_unittest
|
||||||
import unittest
|
import unittest
|
||||||
import sys, os
|
import sys, os
|
||||||
import warnings
|
|
||||||
|
|
||||||
class FrozenTests(unittest.TestCase):
|
class FrozenTests(unittest.TestCase):
|
||||||
def test_frozen(self):
|
def test_frozen(self):
|
||||||
|
|
|
@ -43,14 +43,18 @@ def fixdir(lst):
|
||||||
# from package import * (defined in __init__)
|
# from package import * (defined in __init__)
|
||||||
|
|
||||||
|
|
||||||
class Test(unittest.TestCase):
|
class TestPkg(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.root = None
|
self.root = None
|
||||||
self.syspath = list(sys.path)
|
self.syspath = list(sys.path)
|
||||||
|
self.sysmodules = sys.modules.copy()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
sys.path[:] = self.syspath
|
sys.path[:] = self.syspath
|
||||||
|
sys.modules.clear()
|
||||||
|
sys.modules.update(self.sysmodules)
|
||||||
|
del self.sysmodules
|
||||||
cleanout(self.root)
|
cleanout(self.root)
|
||||||
|
|
||||||
def run_code(self, code):
|
def run_code(self, code):
|
||||||
|
|
Loading…
Reference in New Issue