My nox function looks something like this
@nox.session(python=["3.7", "3.8", "3.9"])
def test(session: nox.Session) -> None:
"""Run unit tests."""
session.install("-e", ".[all]")
session.install("-e", ".[tests]")
print (session.posargs)
session.run("pytest", *session.posargs)
How to update the above function to run tests of specific files or file patterns like tests/*/test_postgres_*.py
Here’s a quick example that demonstrates how to use arguments to run tests against a particular file:
you run:
Then nox will run:
nox posargs