summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/source/test_file_loader.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-10-25 16:33:59 (GMT)
committerBrett Cannon <brett@python.org>2013-10-25 16:33:59 (GMT)
commitb3d6afff2be489a6e6aefbd0826eeacbe565f6d7 (patch)
treea38316d4dbfe83e2505fc622b6b382e8feb741af /Lib/test/test_importlib/source/test_file_loader.py
parentc60dd5b0d4eee2bd239b91565d2ecaa582c4fca5 (diff)
downloadcpython-b3d6afff2be489a6e6aefbd0826eeacbe565f6d7.zip
cpython-b3d6afff2be489a6e6aefbd0826eeacbe565f6d7.tar.gz
cpython-b3d6afff2be489a6e6aefbd0826eeacbe565f6d7.tar.bz2
Issue #16803: Stop having test.test_importlib.abc ABCs inherit from
unittest.TestCase in prep of running tests under frozen and source importlib.
Diffstat (limited to 'Lib/test/test_importlib/source/test_file_loader.py')
-rw-r--r--Lib/test/test_importlib/source/test_file_loader.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py
index 66ad96e..9e035ea 100644
--- a/Lib/test/test_importlib/source/test_file_loader.py
+++ b/Lib/test/test_importlib/source/test_file_loader.py
@@ -19,7 +19,7 @@ import unittest
from test.support import make_legacy_pyc, unload
-class SimpleTest(unittest.TestCase):
+class SimpleTest(unittest.TestCase, abc.LoaderTests):
"""Should have no issue importing a source module [basic]. And if there is
a syntax error, it should raise a SyntaxError [syntax error].
@@ -177,6 +177,11 @@ class SimpleTest(unittest.TestCase):
# The pyc file was created.
os.stat(compiled)
+ def test_unloadable(self):
+ loader = machinery.SourceFileLoader('good name', {})
+ with self.assertRaises(ImportError):
+ loader.load_module('bad name')
+
class BadBytecodeTest(unittest.TestCase):