mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
add ability to specify an individual Python test
This commit is contained in:
parent
4adf6c62e0
commit
1b98e7e48f
1 changed files with 6 additions and 1 deletions
|
@ -7,4 +7,9 @@ os.environ["SHIFT_CLOCK_HACK"] = "1"
|
|||
|
||||
if __name__ == "__main__":
|
||||
folder = os.path.join(os.path.dirname(__file__), "..", "tests")
|
||||
sys.exit(pytest.main(["--verbose", "-s", folder]))
|
||||
args = ["--verbose", "-s", folder]
|
||||
# allow specifying an individual test, eg
|
||||
# bazel test //pylib:pytest --test_env=PYTEST=test_bury
|
||||
if pytest_extra := os.environ.get("PYTEST", ""):
|
||||
args.extend(["-k", pytest_extra])
|
||||
sys.exit(pytest.main(args))
|
||||
|
|
Loading…
Reference in a new issue