(
tmpdir, # type: Any
comment=b"", # type: bytes
)
| 56 | |
| 57 | |
| 58 | def create_zipapp( |
| 59 | tmpdir, # type: Any |
| 60 | comment=b"", # type: bytes |
| 61 | ): |
| 62 | # type: (...) -> str |
| 63 | |
| 64 | zip_file = os.path.join(str(tmpdir), "zip_file") |
| 65 | with open_zip(zip_file, "w") as zip_fp: |
| 66 | zip_fp.writestr("__main__.py", b"print('42')") |
| 67 | zip_fp.writestr("data.py", b"import pkgutil; print(pkgutil.getdata(__name__, 'data'))") |
| 68 | zip_fp.writestr("data", b"42") |
| 69 | zip_fp.comment = comment |
| 70 | assert_zipapp(zip_file, expected_comment=comment) |
| 71 | return zip_file |
| 72 | |
| 73 | |
| 74 | @pytest.mark.parametrize( |
no test coverage detected