Skip to content

Commit 4c08fab

Browse files
authored
MNT: Coverage updates (#36)
* MNT: Do not omit tests from coverage * MNT: Set fallback __version__, ignore coverage * CI: Do not submit etelemetry during tests * CI: Update pytest invocation to get test coverage
1 parent d033633 commit 4c08fab

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.coveragerc

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
branch = True
33
omit =
44
*/_version.py
5-
*/tests/*
5+
6+
[paths]
7+
source =
8+
pydra/tasks
9+
/**/pydra/tasks

.github/workflows/pythonpackage.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ name: Python package
77
env:
88
SUBPACKAGE: nipype1
99
FSLCONDA: https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/
10+
NO_ET: 1 # etelemetry causes order-of-magnitude slowdowns
1011

1112
on:
1213
push:
@@ -86,8 +87,8 @@ jobs:
8687
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
8788
- name: Test with pytest
8889
run: |
89-
pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \
90-
--cov pydra.tasks.$SUBPACKAGE --cov-report xml
90+
pytest -sv --doctest-modules --pyargs pydra.tasks.$SUBPACKAGE \
91+
--cov pydra.tasks.$SUBPACKAGE --cov-report xml --cov-report term-missing
9192
- uses: codecov/codecov-action@v4
9293
if: ${{ always() }}
9394
with:

codecov.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
coverage:
22
range: "50...100"
33
ignore: # files and folders that will be removed during processing
4-
- "**/tests"
54
- "**/_version.py"
6-
- "setup.py"
7-
- "versioneer.py"
85
status:
96
project:
107
default:

pydra/tasks/nipype1/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
try:
77
from ._version import __version__
8-
except ImportError:
9-
pass
8+
except ImportError: # pragma: no cover
9+
__version__ = "0+unknown"
1010

1111
from .utils import Nipype1Task
1212

0 commit comments

Comments
 (0)