MCPcopy Index your code
hub / github.com/python/cpython / testImporterAttr

Method testImporterAttr

Lib/test/test_zipimport.py:756–765  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

754 self.assertRaises(OSError, zi.get_data, os.path.join(TEMP_ZIP, 'a', 'b'))
755
756 def testImporterAttr(self):
757 src = """if 1: # indent hack
758 def get_file():
759 return __file__
760 if __loader__.get_data("some.data") != b"some data":
761 raise AssertionError("bad data")\n"""
762 pyc = make_pyc(compile(src, "<???>", "exec"), NOW, len(src))
763 files = {TESTMOD + pyc_ext: pyc,
764 "some.data": "some data"}
765 self.doTest(pyc_ext, files, TESTMOD, prefix='')
766
767 def testDefaultOptimizationLevel(self):
768 # zipimport should use the default optimization level (#28131)

Callers

nothing calls this directly

Calls 3

doTestMethod · 0.95
make_pycFunction · 0.85
compileFunction · 0.50

Tested by

no test coverage detected