Skip to content

Commit ede36d0

Browse files
pragma for excluding test utils
1 parent e927c52 commit ede36d0

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
MP_API_KEY: ${{ secrets[env.API_KEY_NAME] }}
6363
# MP_API_ENDPOINT: https://api-preview.materialsproject.org/
6464
run: |
65-
pytest -n auto -x --cov=mp_api --omit=mp_api/_test_utils.py --cov-report=xml
65+
pytest -n auto -x --cov=mp_api --cov-report=xml
6666
- uses: codecov/codecov-action@v1
6767
with:
6868
token: ${{ secrets.CODECOV_TOKEN }}

mp_api/_test_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Define testing utils that need to imported."""
22

3+
# pragma: exclude file
4+
35
from __future__ import annotations
46

57
try:

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,9 @@ isort.required-imports = ["from __future__ import annotations"]
122122
[tool.mypy]
123123
namespace_packages = true
124124
ignore_missing_imports = true
125+
126+
[tool.coverage.report]
127+
exclude_also = [
128+
# A pragma comment that excludes an entire file:
129+
'\A(?s:.*# pragma: exclude file.*)\Z',
130+
]

0 commit comments

Comments
 (0)