mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
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:
parent
c60dd5b0d4
commit
b3d6afff2b
9 changed files with 16 additions and 16 deletions
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue