Skip to content

Commit

Permalink
Use pytest-custom_exit_code to not flag empty notebook test suite as … (
Browse files Browse the repository at this point in the history
#728)

* Use pytest-custom_exit_code to not flag empty notebook test suite as a CI failure

* Add missing hyphen to argument
  • Loading branch information
jklaise authored Jul 29, 2022
1 parent a8a9bbd commit 05f44dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test_all_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
os: [ubuntu-latest]
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
include: # Run macos and windows tests on only one python version
- os: windows-latest
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
- os: windows-latest
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
python-version: '3.10'

steps:
Expand Down Expand Up @@ -52,4 +52,4 @@ jobs:
- name: Run notebooks
run: |
pytest --no-cov -rA --durations=0 -vv testing/test_notebooks.py
pytest --suppress-no-test-exit-code --no-cov -rA --durations=0 -vv testing/test_notebooks.py
8 changes: 4 additions & 4 deletions .github/workflows/test_changed_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
os: [ubuntu-latest]
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
include: # Run macos and windows tests on only one python version
- os: windows-latest
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
- os: windows-latest
python-version: '3.9' # PyTorch doesn't yet have 3.10 support on Windows (https://pytorch.org/get-started/locally/#windows-python)
- os: macos-latest
python-version: '3.10'

steps:
Expand Down Expand Up @@ -73,4 +73,4 @@ jobs:
# adding the `or` quantifier between the names and concatenating with the test name `test_notebook_execution`.
run: |
tests="test_notebook_execution[$(echo ${FILES} | sed 's|doc/source/examples/||g' | sed 's| | or |g')]" &&
pytest --no-cov -rA --durations=0 -vv testing/test_notebooks.py -k "$tests"
pytest --suppress-no-test-exit-code --no-cov -rA --durations=0 -vv testing/test_notebooks.py -k "$tests"
1 change: 1 addition & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pytest>=5.3.5, <7.0.0
pytest-cov>=2.6.1, <4.0.0
pytest-xdist>=1.28.0, <3.0.0 # for distributed testing, currently unused (see setup.cfg)
pytest-lazy-fixture>=0.6.3, <0.7.0
pytest-custom_exit_code>=0.3.0 # for notebook tests
pytest-timeout>=1.4.2, <3.0.0 # for notebook tests
jupytext>=1.12.0, <2.0.0 # for notebook tests
ipykernel>=5.1.0, <6.0.0 # for notebook tests
Expand Down

0 comments on commit 05f44dc

Please sign in to comment.