MCPcopy Index your code
hub / github.com/numpy/numpy / test_pyinstaller

Function test_pyinstaller

numpy/_pyinstaller/tests/test_pyinstaller.py:13–35  ·  view source on GitHub ↗

Compile and run pyinstaller-smoke.py using PyInstaller.

(mode, tmp_path)

Source from the content-addressed store, hash-verified

11@pytest.mark.parametrize("mode", ["--onedir", "--onefile"])
12@pytest.mark.slow
13def test_pyinstaller(mode, tmp_path):
14 """Compile and run pyinstaller-smoke.py using PyInstaller."""
15
16 pyinstaller_cli = pytest.importorskip("PyInstaller.__main__").run
17
18 source = Path(__file__).with_name("pyinstaller-smoke.py").resolve()
19 args = [
20 # Place all generated files in ``tmp_path``.
21 '--workpath', str(tmp_path / "build"),
22 '--distpath', str(tmp_path / "dist"),
23 '--specpath', str(tmp_path),
24 mode,
25 str(source),
26 ]
27 pyinstaller_cli(args)
28
29 if mode == "--onefile":
30 exe = tmp_path / "dist" / source.stem
31 else:
32 exe = tmp_path / "dist" / source.stem / source.stem
33
34 p = subprocess.run([str(exe)], check=True, stdout=subprocess.PIPE)
35 assert p.stdout.strip() == b"I made it!"

Callers

nothing calls this directly

Calls 2

stripMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…