2020-07-18 17:35:13 +08:00
|
|
|
"""Generate an executable with pytest runner embedded using PyInstaller."""
|
2018-05-23 22:48:46 +08:00
|
|
|
if __name__ == "__main__":
|
2016-07-27 08:29:07 +08:00
|
|
|
import pytest
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
hidden = []
|
|
|
|
for x in pytest.freeze_includes():
|
2018-05-23 22:48:46 +08:00
|
|
|
hidden.extend(["--hidden-import", x])
|
2019-02-14 04:59:36 +08:00
|
|
|
hidden.extend(["--hidden-import", "distutils"])
|
2018-05-23 22:48:46 +08:00
|
|
|
args = ["pyinstaller", "--noconfirm"] + hidden + ["runtests_script.py"]
|
|
|
|
subprocess.check_call(" ".join(args), shell=True)
|