diff --git a/noxfile.py b/noxfile.py index fd2ba8d..a0855bc 100644 --- a/noxfile.py +++ b/noxfile.py @@ -131,37 +131,41 @@ def mypy(session: nox.Session): # ) +@nox.session(python=False) +def rust_tests(session: nox.Session) -> None: + session.env.update(ENV) + session.run( + "cargo", + "test", + "--release", + "--workspace", + "--exclude", + "pyargus", + external=True, + ) + + @nox.session(python=PYTHONS) -def tests(session: nox.Session): +def python_tests(session: nox.Session) -> None: session.conda_install("pytest", "hypothesis", "lark", "maturin") - session.env.update(ENV) - try: - session.run( - "cargo", - "test", - "--release", - "--workspace", - "--exclude", - "pyargus", - external=True, - ) - except Exception: - ... - try: - session.run( - "maturin", - "develop", - "--release", - "-m", - "./pyargus/Cargo.toml", - "-E", - "test", - silent=True, - ) - with session.chdir(CURRENT_DIR / "pyargus"): - session.run("pytest", ".", "--hypothesis-explain") - except Exception: - ... + session.run( + "maturin", + "develop", + "--release", + "-m", + "./pyargus/Cargo.toml", + "-E", + "test", + silent=True, + ) + with session.chdir(CURRENT_DIR / "pyargus"): + session.run("pytest", ".", "--hypothesis-explain") + + +@nox.session(python=False) +def tests(session: nox.Session): + session.notify("rust_tests") + session.notify("python_tests") @nox.session(python=DEFAULT_PYTHON)