Skip to content

Commit f828c68

Browse files
authored
Fix file-specific test coverage (#2540)
* Fix file-specific test coverage * File-specific test coverage not yet possible
1 parent e42c404 commit f828c68

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

.github/workflows/tests.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: pip list
4444
- name: Run pytest checks
4545
run: |
46-
pytest --cov --cov-report=xml
46+
pytest --cov=torchgeo --cov-report=xml
4747
python3 -m torchgeo --help
4848
- name: Report coverage
4949
uses: codecov/[email protected]
@@ -75,7 +75,7 @@ jobs:
7575
run: pip list
7676
- name: Run pytest checks
7777
run: |
78-
pytest --cov --cov-report=xml
78+
pytest --cov=torchgeo --cov-report=xml
7979
python3 -m torchgeo --help
8080
- name: Report coverage
8181
uses: codecov/[email protected]
@@ -107,7 +107,7 @@ jobs:
107107
run: pip list
108108
- name: Run pytest checks
109109
run: |
110-
pytest --cov --cov-report=xml
110+
pytest --cov=torchgeo --cov-report=xml
111111
python3 -m torchgeo --help
112112
- name: Report coverage
113113
uses: codecov/[email protected]

docs/user/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ For example, if you add a new dataset in ``torchgeo/datasets/foo.py``, you'll ne
5858

5959
.. code-block:: console
6060
61-
$ pytest --cov=torchgeo.datasets.foo tests/datasets/test_foo.py
61+
$ pytest --cov=torchgeo.datasets tests/datasets/test_foo.py
6262
========================= test session starts =========================
6363
platform darwin -- Python 3.10.11, pytest-6.2.4, py-1.9.0, pluggy-0.13.0
6464
rootdir: ~/torchgeo, configfile: pyproject.toml

pyproject.toml

-3
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ exclude_also = [
144144
]
145145
show_missing = true
146146

147-
[tool.coverage.run]
148-
source_pkgs = ["torchgeo"]
149-
150147
# https://mypy.readthedocs.io/en/stable/config_file.html
151148
[tool.mypy]
152149
# Import discovery

0 commit comments

Comments
 (0)