Skip to content

Commit

Permalink
Do not run pytest coverage by default
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckwondo committed Jan 28, 2025
1 parent 904daa3 commit 33998d9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ comment:
branches: # branch names that can post comment
- "main"
ignore:
- "conftest.py"
- "virtualizarr/tests" # ignore folders and all its contents
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Running Tests
run: |
python -m pytest --run-network-tests --cov-report=xml --verbose virtualizarr
python -m pytest --run-network-tests --verbose --cov=virtualizarr --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/min-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Running Tests
run: |
python -m pytest --cov-report=xml --verbose virtualizarr
python -m pytest --verbose --cov=virtualizarr --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Running Tests
run: |
python -m pytest --cov-report=xml --verbose virtualizarr
python -m pytest --verbose --cov=virtualizarr --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
Expand Down
17 changes: 12 additions & 5 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ that require downloading files over the network. Skip this if you want the test
faster or you have no internet access:

```bash
pytest -m pytest --run-network-tests
python -m pytest --run-network-tests
```

Further, we use the `pytest-cov` plugin to generate a test coverage report. By default,
a report showing lines missing coverage will be printed to the terminal. You may supply
additional options to `pytest` to generate other outputs, such as an HTML report (via
`--cov-report=html`). For all available options added by the `pytest-cov` plugin, run
Further, the `pytest-cov` plugin is a test dependency, so you can generate a test
coverage report locally, if you wish (CI will automatically do so). Here are some
examples:

```bash
python -m pytest --cov=. # Terminal (text) report (--cov=term)
python -m pytest --cov=. --cov=term-missing # Terminal report showing missing coverage
python -m pytest --cov=. --cov=html # HTML report written to htmlcov/index.html
```

To see all available `pytest` options added by the `pytest-cov` plugin, run
`python -m pytest -h`, or see the
[pytest-cov documentation](https://pytest-cov.readthedocs.io/en/latest/readme.html).

Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,10 @@ line-ending = "auto"
known-first-party = ["virtualizarr"]

[tool.coverage.run]
omit = ["virtualizarr/tests/*"]
include = ["virtualizarr/"]
omit = ["conftest.py", "virtualizarr/tests/*"]

[tool.pytest.ini_options]
addopts = [
"--cov=virtualizarr",
"--cov-report=term-missing",
]
# See https://pytest-asyncio.readthedocs.io/en/latest/concepts.html#asyncio-event-loops
# Explicitly set asyncio_default_fixture_loop_scope to eliminate the following warning:
#
Expand Down

0 comments on commit 33998d9

Please sign in to comment.