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

Do not pick up test options in coverage session when notified #95

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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