summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-04-06 17:13:08 (GMT)
committerBrett Cannon <brett@python.org>2012-04-06 17:13:08 (GMT)
commitd62cd5627fc5c01571c018b8a11b152614862eff (patch)
tree7c117b3afbfaff3f6bb74e138eb7c285cd64d55d /Lib
parent83c02ee8e8d62dbdd1576f2d02a7925b4381cc02 (diff)
downloadcpython-d62cd5627fc5c01571c018b8a11b152614862eff.zip
cpython-d62cd5627fc5c01571c018b8a11b152614862eff.tar.gz
cpython-d62cd5627fc5c01571c018b8a11b152614862eff.tar.bz2
Issue #14500: Fix importlib.test.import_.test_packages to clean up
after itself properly.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/importlib/test/import_/test_packages.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/importlib/test/import_/test_packages.py b/Lib/importlib/test/import_/test_packages.py
index 9590d5f..58be433 100644
--- a/Lib/importlib/test/import_/test_packages.py
+++ b/Lib/importlib/test/import_/test_packages.py
@@ -3,6 +3,7 @@ from . import util as import_util
import sys
import unittest
import importlib
+from test import support
class ParentModuleTests(unittest.TestCase):
@@ -38,7 +39,10 @@ class ParentModuleTests(unittest.TestCase):
module_code={'mod': module_injection})
with mock_modules as mock:
with util.import_state(meta_path=[mock]):
- submodule = import_util.import_(subname)
+ try:
+ submodule = import_util.import_(subname)
+ finally:
+ support.unload(subname)
def test_main():