Skip to content

Commit

Permalink
tests: fix coverage issues
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 8, 2024
1 parent 403b1dd commit 47d8f8f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,8 @@ jobs:

- uses: astral-sh/setup-uv@v3

- name: Install package
run: uv pip install -e.[test] --system

- name: Test package
run: pytest -ra --cov=check-sdist
run: uvx nox -s coverage

- name: Upload coverage report
uses: codecov/codecov-action@v4
Expand Down
10 changes: 8 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def tests(session: nox.Session) -> None:
Run the unit and regular tests.
"""
session.install("-e.[test]")
session.run("pytest", *session.posargs)
session.run("pytest", *session.posargs, env={"COVERAGE_CORE": "sysmon"})


@nox.session
Expand All @@ -43,7 +43,13 @@ def coverage(session: nox.Session) -> None:
Run tests and compute coverage.
"""

session.posargs.append("--cov=check-sdist")
session.posargs.extend(
[
"--cov-config=pyproject.toml",
"--cov-report=xml",
"--cov-report=term-missing",
]
)
tests(session)


Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ testpaths = [
]


[tool.coverage]
run.source = ["check_sdist"]


[tool.mypy]
files = ["src", "tests"]
python_version = "3.8"
Expand Down

0 comments on commit 47d8f8f

Please sign in to comment.