📂 FileMgr
📍
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
numpy
/
_pyinstaller
✏️ r/test_pyinstaller.py
⬅ Kembali
import subprocess from pathlib import Path import pytest # PyInstaller has been very unproactive about replacing 'imp' with 'importlib'. @pytest.mark.filterwarnings('ignore::DeprecationWarning') # It also leaks io.BytesIO()s. @pytest.mark.filterwarnings('ignore::ResourceWarning') @pytest.mark.parametrize("mode", ["--onedir", "--onefile"]) @pytest.mark.slow 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!"
💾 Simpan
Batal
⬅ numpy
5 item
Nama
Tipe
Ukuran
Diubah
Aksi
📁
__pycache__
dir
—
2026-03-11 18:53
📂 Buka
✏️ Rename
🗑
🐍
__init__.py
py
0 B
2026-01-20 12:58
✏️
👁️
🔤
🗑
🐍
hook-numpy.py
py
1.4 KB
2026-01-20 12:58
✏️
👁️
🔤
🗑
🐍
pyinstaller-smoke.py
py
1.1 KB
2026-01-20 12:58
✏️
👁️
🔤
🗑
🐍
test_pyinstaller.py
py
1.1 KB
2026-01-20 12:58
✏️
👁️
🔤
🗑
✏️ Rename
Nama Baru
Simpan
Batal