MCPcopy
hub / github.com/django/django / test_zip_reload

Method test_zip_reload

tests/utils_tests/test_autoreload.py:119–130  ·  view source on GitHub ↗

Modules imported from zipped files have their archive location included in the result.

(self)

Source from the content-addressed store, hash-verified

117 self.assertFileFound(filename)
118
119 def test_zip_reload(self):
120 """
121 Modules imported from zipped files have their archive location included
122 in the result.
123 """
124 zip_file = self.temporary_file("zip_import.zip")
125 with zipfile.ZipFile(str(zip_file), "w", zipfile.ZIP_DEFLATED) as zipf:
126 zipf.writestr("test_zipped_file.py", "")
127
128 with extend_sys_path(str(zip_file)):
129 self.import_and_cleanup("test_zipped_file")
130 self.assertFileFound(zip_file)
131
132 def test_bytecode_conversion_to_source(self):
133 """.pyc and .pyo files are included in the files list."""

Callers

nothing calls this directly

Calls 4

temporary_fileMethod · 0.95
import_and_cleanupMethod · 0.95
assertFileFoundMethod · 0.95
extend_sys_pathFunction · 0.90

Tested by

no test coverage detected