summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_zipimport.py')
-rw-r--r--Lib/test/test_zipimport.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index 5f6d8ef..3c790eb 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -56,9 +56,10 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
mod = __import__(".".join(modules), globals(), locals(),
["__dummy__"])
- file = mod.get_file()
- self.assertEquals(file, os.path.join(TEMP_ZIP,
- os.sep.join(modules) + expected_ext))
+ if expected_ext:
+ file = mod.get_file()
+ self.assertEquals(file, os.path.join(TEMP_ZIP,
+ os.sep.join(modules) + expected_ext))
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -101,6 +102,10 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
TESTMOD + pyc_ext: (NOW, test_pyc)}
self.doTest(pyc_ext, files, TESTMOD)
+ def testEmptyPy(self):
+ files = {TESTMOD + ".py": (NOW, "")}
+ self.doTest(None, files, TESTMOD)
+
def testBadMagic(self):
# make pyc magic word invalid, forcing loading from .py
m0 = ord(test_pyc[0])