Skip to content

Commit

Permalink
Generate coverage report only once
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo-peronio committed Oct 12, 2024
1 parent 57c30a2 commit e829c79
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true

publish-to-testpypi:
name: Publish to TestPyPI
Expand Down
13 changes: 11 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def version_tuple(version: str) -> tuple[int, ...]:


@nox.session(python=python_versions + pypy_versions)
def test(session: Session) -> None:
"""Test."""
def test_python(session: Session) -> None:
"""Test the supported Python versions."""
session.install(".[test]")
session.run("pytest")

Expand All @@ -63,3 +63,12 @@ def test_oldest(session: Session) -> None:
"""Test the oldest supported versions of Python and the dependencies."""
session.install(f"numpy=={numpy_python_versions[0][0]}", ".[test]")
session.run("pytest")


@nox.session()
def coverage(session: Session) -> None:
"""Generate test coverage report."""
# We generate XML because Codecov would convert it to XML anyway.
# Coverage analysis slows down the testing, so we do it only once.
session.install(".[test]")
session.run("pytest", "--cov=gsffile", "--cov-report=xml")
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ local_scheme = "no-local-version"
[tool.pytest.ini_options]
addopts = [
"-ra",
"--cov=gsffile",
"--import-mode=importlib",
"--strict-config",
"--strict-markers",
Expand Down

0 comments on commit e829c79

Please sign in to comment.