Skip to content

Commit

Permalink
Switch to pytest-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed Jun 24, 2024
1 parent 5415c48 commit d71b650
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# .coveragerc to control coverage.py
# following the example at http://nedbatchelder.com/code/coverage/config.html
[run]
concurrency = multiprocessing
parallel = True
sigterm = True
relative_files = True
branch = True
source_pkgs = brian2
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Install Brian2 and dependencies
run: |
conda install --quiet --yes pip gsl
python -m pip install .[test] coverage
python -m pip install .[test]
- name: Determine Cython cache dir
id: cython-cache
Expand All @@ -92,9 +92,8 @@ jobs:
- name: Run Tests
run: |
cd $GITHUB_WORKSPACE/.. # move out of the workspace to avoid direct import
coverage run --rcfile=$GITHUB_WORKSPACE/.coveragerc $GITHUB_WORKSPACE/$SCRIPT_NAME
coverage lcov --rcfile=$GITHUB_WORKSPACE/.coveragerc
cp coverage.lcov $GITHUB_WORKSPACE/
python $GITHUB_WORKSPACE/$SCRIPT_NAME
cp coverage.xml $GITHUB_WORKSPACE/
env:
SCRIPT_NAME: dev/continuous-integration/run_test_suite.py
SPHINX_DIR: ${{ github.workspace }}/docs_sphinx
Expand All @@ -106,8 +105,6 @@ jobs:
uses: coverallsapp/github-action@v2.3.0
with:
parallel: true
format: lcov
file: coverage.lcov
flag-name: run ${{ join(matrix.*, ' - ') }}

coveralls:
Expand Down
2 changes: 1 addition & 1 deletion dev/continuous-integration/run_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
if deprecation_error:
args = ['-W', 'error::DeprecationWarning', '--tb=short']
else:
args = []
args = ['--cov', '--cov-append']

if standalone:
result = brian2.test([],
Expand Down
2 changes: 1 addition & 1 deletion numpy2.pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ classifiers = [
]

[project.optional-dependencies]
test = ['pytest', 'pytest-xdist>=1.22.3']
test = ['pytest', 'pytest-xdist>=1.22.3', 'pytest-cov>=2.0']
docs = ['sphinx>=7', 'ipython>=5', 'sphinx-tabs']

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ classifiers = [
]

[project.optional-dependencies]
test = ['pytest', 'pytest-xdist>=1.22.3']
test = ['pytest', 'pytest-xdist>=1.22.3', 'pytest-cov>=2.0']
docs = ['sphinx>=7', 'ipython>=5', 'sphinx-tabs']

[project.urls]
Expand Down

0 comments on commit d71b650

Please sign in to comment.