diff options
Diffstat (limited to 'Lib/test/test_zipimport.py')
| -rw-r--r-- | Lib/test/test_zipimport.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index 1e351c8..5b8d77c 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -450,7 +450,10 @@ 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) + self.assertIsInstance(cm.exception.__context__, PermissionError) finally: # If we leave "the read-only bit" set on Windows, nothing can # delete TESTMOD, and later tests suffer bogus failures. |
