diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index e4739e0..0c1fc2a 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -53,8 +53,8 @@ jobs: uv sync --only-group=nox --locked - name: Run Nox 🦊 run: - uv run --no-sync nox -s test + uv run --no-sync nox -s test -- --cov --cov-append --cov-report=xml:coverage.xml - name: Upload coverage reports to Codecov ⛱️ - uses: codecov/codecov-action@v5.5.5 + uses: codecov/codecov-action@v7.0.0 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/noxfile.py b/noxfile.py index 1a74516..28ba265 100644 --- a/noxfile.py +++ b/noxfile.py @@ -33,4 +33,4 @@ def ruff(session: nox.Session) -> None: ], ) def test(session: nox.Session) -> None: - session.run("pytest") + session.run("pytest", *session.posargs) diff --git a/pyproject.toml b/pyproject.toml index 83bf232..23eeef5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -144,11 +144,6 @@ addopts = [ "-ra", "-q", "--strict-markers", - "--cov=src/", - "--cov-branch", - "--cov-append", - "--cov-report=term-missing:skip-covered", - "--cov-report=xml", "--suppress-no-test-exit-code", ] pythonpath = [".", "src"] @@ -157,6 +152,10 @@ testpaths = ["tests/"] # Coverage.py # https://coverage.readthedocs.io/en/latest/config.html +[tool.coverage.run] +branch = true +source = ["src/"] + [tool.coverage.report] exclude_also = [ "@(abc\\.)?abstractmethod", @@ -171,3 +170,6 @@ exclude_also = [ "raise AssertionError", "raise NotImplementedError", ] +show_missing = true +skip_covered = true +skip_empty = true