From 3310185e04bc2f2df844e5fdc1ca3cbb0a844b4b Mon Sep 17 00:00:00 2001 From: staticdev Date: Tue, 23 Jun 2020 12:48:00 -0300 Subject: [PATCH] Coverage session --- noxfile.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 1870dd1..ebaa1b0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -152,10 +152,15 @@ def tests(session: Session) -> None: @nox.session def coverage(session: Session) -> None: """Produce the coverage report.""" - args = session.posargs or ["report"] + # Do not use session.posargs unless this is the only session. + has_args = session.posargs and len(session._runner.manifest) == 1 + args = session.posargs if has_args else ["report"] + install(session, "coverage[toml]") - if not session.posargs and any(Path().glob(".coverage.*")): + + if not has_args and any(Path().glob(".coverage.*")): session.run("coverage", "combine") + session.run("coverage", *args)