Buckets:
ranranrunforit/build-small-hackathon-storage / pylibs /numpy /_pyinstaller /tests /test_pyinstaller.py
| import subprocess | |
| from pathlib import Path | |
| import pytest | |
| # PyInstaller has been very unproactive about replacing 'imp' with 'importlib'. | |
| # It also leaks io.BytesIO()s. | |
| def test_pyinstaller(mode, tmp_path): | |
| """Compile and run pyinstaller-smoke.py using PyInstaller.""" | |
| pyinstaller_cli = pytest.importorskip("PyInstaller.__main__").run | |
| source = Path(__file__).with_name("pyinstaller-smoke.py").resolve() | |
| args = [ | |
| # Place all generated files in ``tmp_path``. | |
| '--workpath', str(tmp_path / "build"), | |
| '--distpath', str(tmp_path / "dist"), | |
| '--specpath', str(tmp_path), | |
| mode, | |
| str(source), | |
| ] | |
| pyinstaller_cli(args) | |
| if mode == "--onefile": | |
| exe = tmp_path / "dist" / source.stem | |
| else: | |
| exe = tmp_path / "dist" / source.stem / source.stem | |
| p = subprocess.run([str(exe)], check=True, stdout=subprocess.PIPE) | |
| assert p.stdout.strip() == b"I made it!" | |
Xet Storage Details
- Size:
- 1.14 kB
- Xet hash:
- 6a69c821a5e3602f8849c37f05e47a9e93dfd03e72dbfe253091183e9ed54ee3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.