Skip to content

Commit

Permalink
Fix coverage session inside generated project (#62)
Browse files Browse the repository at this point in the history
Fixes #61
  • Loading branch information
santacodes authored Sep 8, 2024
1 parent f93cda6 commit 2d74f64
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions template/{{ project_name }}/noxfile.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ def run_user_tests(session):
@nox.session(name="coverage")
def run_coverage(session):
"""Run the coverage tests and generate an XML report."""
session.posargs.append("--cov=src/{{project_slug}}")
session.posargs.append("--cov-report=xml")
run_user_tests(session)
session.install("setuptools", silent=False)
session.install("coverage", silent=False)
session.install("-e", ".[dev]", silent=False)
session.run("pytest", "--cov=src/{{project_slug}}", "--cov-report=xml", "tests/")

@nox.session(name="dev")
def set_dev(session):
Expand Down

0 comments on commit 2d74f64

Please sign in to comment.