diff options
Diffstat (limited to 'Lib/test/test_zipimport.py')
-rw-r--r-- | Lib/test/test_zipimport.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index 1e351c8c8a..a97a7784bd 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -51,7 +51,7 @@ TESTPACK2 = "ziptestpackage2" TEMP_ZIP = os.path.abspath("junk95142.zip") pyc_file = importlib.util.cache_from_source(TESTMOD + '.py') -pyc_ext = ('.pyc' if __debug__ else '.pyo') +pyc_ext = '.pyc' class ImportHooksBaseTestCase(unittest.TestCase): @@ -450,7 +450,9 @@ class BadFileZipImportTestCase(unittest.TestCase): fd = os.open(TESTMOD, os.O_CREAT, 000) try: os.close(fd) - self.assertZipFailure(TESTMOD) + + with self.assertRaises(zipimport.ZipImportError) as cm: + zipimport.zipimporter(TESTMOD) finally: # If we leave "the read-only bit" set on Windows, nothing can # delete TESTMOD, and later tests suffer bogus failures. |