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

Commit

Permalink
Coverage session
Browse files Browse the repository at this point in the history
  • Loading branch information
staticdev committed Jun 23, 2020
1 parent 7856095 commit c342f6e
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 c342f6e

Please sign in to comment.