From c342f6e1ca0bcf1374f9d35a393dcd1ca2857994 Mon Sep 17 00:00:00 2001 From: staticdev Date: Tue, 23 Jun 2020 12:51:56 -0300 Subject: [PATCH] Coverage session --- noxfile.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 8cb8644..821b651 100644 --- a/noxfile.py +++ b/noxfile.py @@ -151,10 +151,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)