Allow passing through arguments to pytest
Can enable running individual tests or supllying any other arguments. Will remove the default argument `--cov`.
This commit is contained in:
parent
abd48e0ee8
commit
851b14591f
2 changed files with 2 additions and 2 deletions
|
@ -3,6 +3,7 @@ import nox
|
||||||
|
|
||||||
@nox.session(python=["3.7", "3.8", "3.9"])
|
@nox.session(python=["3.7", "3.8", "3.9"])
|
||||||
def tests(session):
|
def tests(session):
|
||||||
|
args = session.posargs or ["--cov"]
|
||||||
session.run("poetry", "install", external=True)
|
session.run("poetry", "install", external=True)
|
||||||
session.run("pytest", "--cov")
|
session.run("pytest", *args)
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -15,7 +15,6 @@ click = "^8.0"
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
pytest = "^6.2"
|
pytest = "^6.2"
|
||||||
coverage = {extras = ["toml"], version = "^6.2"}
|
coverage = {extras = ["toml"], version = "^6.2"}
|
||||||
|
|
||||||
pytest-cov = "^3.0.0"
|
pytest-cov = "^3.0.0"
|
||||||
pytest-mock = "^3.6.1"
|
pytest-mock = "^3.6.1"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue