Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 00bca55

Browse files
author
staticdev
committed
Coverage session
1 parent 6f40549 commit 00bca55

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

noxfile.py

+7-2
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)