test_ok2/testing/freeze/create_executable.py

13 lines
378 B
Python
Raw Normal View History

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