From 00bca55eb4454ae0893fc97a994bd041b5c718de Mon Sep 17 00:00:00 2001 From: staticdev Date: Tue, 23 Jun 2020 12:53:09 -0300 Subject: [PATCH] Coverage session --- noxfile.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 4af88d9..aa37b2a 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)