Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
pytest-args:
description: 'Additional arguments to pass to pytest'
required: false
default: '--mpl -W error::metpy.deprecation.MetpyDeprecationWarning'
default: '--mpl -W error::metpy.deprecation.MetpyDeprecationWarning -n auto --cov --cov-report=xml'
runs:
using: composite
steps:
Expand All @@ -30,10 +30,8 @@ runs:
# By running coverage in "parallel" mode and "combining", we can clean up the path names
run: |
set -e -o pipefail
python -m coverage run -p -m pytest ${{ inputs.pytest-args }} tests/ 2>&1 | tee tests-${{ inputs.key }}.log
python -m coverage combine
python -m coverage report
python -m coverage xml
python -m pytest ${{ inputs.pytest-args }} tests/ 2>&1 | tee tests-${{ inputs.key }}.log


- name: Run doctests
if: ${{ inputs.run-doctests == 'true' }}
Expand Down
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,14 @@ To run these tests, use:

```sh
pytest --mpl
````
```

To run tests in parallel, use `-n <number_of_processes>` or `-n auto` (using `pytest-xdist`):

```sh
pytest --mpl -n auto
pytest --mpl -n 2
```

When adding new image comparison tests, start by creating the baseline images for the tests:

Expand Down
2 changes: 2 additions & 0 deletions ci-dev/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
packaging==25.0
pytest==8.4.0
pytest-cov==6.2.1
pytest-mpl==0.17.0
pytest-xdist==3.8.0
coverage==7.10.2
vcrpy==7.0.0
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ test = [
"netCDF4",
"packaging>=21.0",
"pytest>=7.0",
"pytest-xdist",
"pytest-cov",
"pytest-mpl",
"vcrpy>=4.3.1"
]
Expand Down
Loading