Skip to content

Commit

Permalink
MNT: Coverage updates (#36)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
effigies authored Mar 23, 2024
1 parent d033633 commit 4c08fab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
branch = True
omit =
*/_version.py
*/tests/*

[paths]
source =
pydra/tasks
/**/pydra/tasks
5 changes: 3 additions & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: Python package
env:
SUBPACKAGE: nipype1
FSLCONDA: https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/
NO_ET: 1 # etelemetry causes order-of-magnitude slowdowns

on:
push:
Expand Down Expand Up @@ -86,8 +87,8 @@ jobs:
python -c "import pydra as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
- name: Test with pytest
run: |
pytest -sv --doctest-modules pydra/tasks/$SUBPACKAGE \
--cov pydra.tasks.$SUBPACKAGE --cov-report xml
pytest -sv --doctest-modules --pyargs pydra.tasks.$SUBPACKAGE \
--cov pydra.tasks.$SUBPACKAGE --cov-report xml --cov-report term-missing
- uses: codecov/codecov-action@v4
if: ${{ always() }}
with:
Expand Down
3 changes: 0 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
coverage:
range: "50...100"
ignore: # files and folders that will be removed during processing
- "**/tests"
- "**/_version.py"
- "setup.py"
- "versioneer.py"
status:
project:
default:
Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/nipype1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

try:
from ._version import __version__
except ImportError:
pass
except ImportError: # pragma: no cover
__version__ = "0+unknown"

from .utils import Nipype1Task

Expand Down

0 comments on commit 4c08fab

Please sign in to comment.