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

Commit

Permalink
Merge pull request #95 from staticdev/new-coverage
Browse files Browse the repository at this point in the history
Do not pick up test options in coverage session when notified
  • Loading branch information
Thiago C. D'Ávila committed Jun 23, 2020
2 parents 6f40549 + 00bca55 commit 8f41c90
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 8f41c90

Please sign in to comment.