Skip to content

Commit

Permalink
move pytest and coverage configuration into setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Dec 5, 2024
1 parent 8bebd3d commit 3f85102
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
28 changes: 0 additions & 28 deletions .coveragerc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
python -m pip install --no-deps --force-reinstall --ignore-installed 'fitsio${{ matrix.fitsio-version }}'
svn export https://desi.lbl.gov/svn/code/desimodel/${DESIMODEL_DATA}/data
- name: Run the test
run: DESIMODEL=$(pwd) pytest py/desispec/test
run: DESIMODEL=$(pwd) pytest

coverage:
name: Test coverage
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
python -m pip install --no-deps --force-reinstall --ignore-installed 'fitsio${{ matrix.fitsio-version }}'
svn export https://desi.lbl.gov/svn/code/desimodel/${DESIMODEL_DATA}/data
- name: Run the test with coverage
run: DESIMODEL=$(pwd) pytest --cov=desispec py/desispec/test
run: DESIMODEL=$(pwd) pytest --cov
- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
31 changes: 31 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
[tool:pytest]
testpaths = py

[coverage:run]
relative_files = True
source =
py/desispec
omit =
py/desispec/_version.py
py/desispec/conftest*
py/desispec/test/*
*/desispec/_version.py
*/desispec/conftest*
*/desispec/test/*

[coverage:report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about packages we have installed
except ImportError
# Don't complain if tests don't hit assertions
raise AssertionError
raise NotImplementedError
# Don't complain about script hooks
def main\(.*\):
# Ignore branches that don't pertain to this version of Python
pragma: py{ignore_python_version}
# Don't complain about IPython completion helper
def _ipython_key_completions_

[pycodestyle]
# See https://pycodestyle.readthedocs.io/en/latest/intro.html#configuration
# for details of these configuration options.
Expand Down

0 comments on commit 3f85102

Please sign in to comment.