Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit 2870c2d

Browse files
author
Thiago C. D'Ávila
authored
Merge pull request #106 from staticdev/new-coverage
Do not pick up test options in coverage session when notified
2 parents 3fd03a0 + 3310185 commit 2870c2d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

noxfile.py

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

161166

0 commit comments

Comments
 (0)