Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Commit 1ce49ad

Browse files
author
Thiago C. D'Ávila
authored
Merge pull request #100 from staticdev/new-coverage
Do not pick up test options in coverage session when notified
2 parents 7856095 + c342f6e commit 1ce49ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

noxfile.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,15 @@ def tests(session: Session) -> None:
151151
@nox.session
152152
def coverage(session: Session) -> None:
153153
"""Produce the coverage report."""
154-
args = session.posargs or ["report"]
154+
# Do not use session.posargs unless this is the only session.
155+
has_args = session.posargs and len(session._runner.manifest) == 1
156+
args = session.posargs if has_args else ["report"]
157+
155158
install(session, "coverage[toml]")
156-
if not session.posargs and any(Path().glob(".coverage.*")):
159+
160+
if not has_args and any(Path().glob(".coverage.*")):
157161
session.run("coverage", "combine")
162+
158163
session.run("coverage", *args)
159164

160165

0 commit comments

Comments
 (0)