summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-06-23 16:09:55 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-06-23 16:09:55 (GMT)
commitd4daa87129d3321297c383b43a40eec7ede0c0f0 (patch)
treedf56eb619ff7fd014a53b382dae8d1ae1c4195a7 /Lib/test/test_import.py
parent06e37587ffddc5fb77f93ab2cefafd6cbd326aee (diff)
downloadcpython-d4daa87129d3321297c383b43a40eec7ede0c0f0.zip
cpython-d4daa87129d3321297c383b43a40eec7ede0c0f0.tar.gz
cpython-d4daa87129d3321297c383b43a40eec7ede0c0f0.tar.bz2
Properly cleanup pep3147 modules in test_import
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index c94d7bd..1746a61 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -636,6 +636,8 @@ class PycacheTests(unittest.TestCase):
# Like test___cached__ but for packages.
def cleanup():
rmtree('pep3147')
+ unload('pep3147.foo')
+ unload('pep3147')
os.mkdir('pep3147')
self.addCleanup(cleanup)
# Touch the __init__.py
@@ -643,8 +645,6 @@ class PycacheTests(unittest.TestCase):
pass
with open(os.path.join('pep3147', 'foo.py'), 'w'):
pass
- unload('pep3147.foo')
- unload('pep3147')
importlib.invalidate_caches()
m = __import__('pep3147.foo')
init_pyc = imp.cache_from_source(
@@ -659,10 +659,10 @@ class PycacheTests(unittest.TestCase):
# PEP 3147 pyc file.
def cleanup():
rmtree('pep3147')
+ unload('pep3147.foo')
+ unload('pep3147')
os.mkdir('pep3147')
self.addCleanup(cleanup)
- unload('pep3147.foo')
- unload('pep3147')
# Touch the __init__.py
with open(os.path.join('pep3147', '__init__.py'), 'w'):
pass