source/tools/python/bzl_pytest_shim.py

19 lines
390 B
Python
Raw Normal View History

2021-04-09 07:16:16 +00:00
"""A shim for executing pytest."""
import os
2021-04-08 06:37:51 +00:00
import sys
import pytest
if __name__ == "__main__":
print(sys.version_info, file=sys.stderr)
print(sys.argv, file=sys.stderr)
cmdline = ["--ignore=external"] + sys.argv[1:]
print(cmdline, file=sys.stderr)
2021-04-09 07:16:16 +00:00
for e in sys.path:
print(f" - {os.path.realpath(e)}", file=sys.stderr)
2021-04-08 06:37:51 +00:00
sys.exit(pytest.main(cmdline))