Issue #16803: Stop having test.test_importlib.abc ABCs inherit from

unittest.TestCase in prep of running tests under frozen and source
importlib.
This commit is contained in:
Brett Cannon 2013-10-25 12:33:59 -04:00
parent c60dd5b0d4
commit b3d6afff2b
9 changed files with 16 additions and 16 deletions

View file

@ -19,7 +19,7 @@
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 @@ def test_timestamp_overflow(self):
# 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):