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

Commit

Permalink
Merge pull request #100 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 authored Jun 23, 2020
2 parents 7856095 + c342f6e commit 1ce49ad
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 @@ -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)


Expand Down

0 comments on commit 1ce49ad

Please sign in to comment.