test_ok2/testing/freeze/create_executable.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
426 B
Python
Raw Permalink Normal View History

"""Generate an executable with pytest runner embedded using PyInstaller."""
2018-05-23 22:48:46 +08:00
if __name__ == "__main__":
import subprocess
import pytest
hidden = []
for x in pytest.freeze_includes():
2018-05-23 22:48:46 +08:00
hidden.extend(["--hidden-import", x])
hidden.extend(["--hidden-import", "distutils"])
args = ["pyinstaller", "--noconfirm", *hidden, "runtests_script.py"]
2018-05-23 22:48:46 +08:00
subprocess.check_call(" ".join(args), shell=True)