Skip to content

Commit

Permalink
Tests: Add rerun functionality for tests
Browse files Browse the repository at this point in the history
We add pytest-rerun to tests and allow the tests to be rerun up to 3
times until they pass. The tests for lab 4 are less stable and fail at
different points for different reasons that are hard to fix. By allowing
the tests to pass with a rerun we avoid these kind of issues.
  • Loading branch information
agoscinski committed Jul 3, 2024
1 parent 6e503b0 commit da46e85
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ setenv =
JUPYTER_DATA_DIR={envdir}/share/jupyter
deps =
pytest<8.0.0
pytest-rerunfailures
pytest-html<4.0.0,
# selenium juypter notebook tests
jupyterlab==3.6.5
Expand All @@ -41,7 +42,7 @@ deps =
commands =
# converts the python files to ipython notebooks
jupytext tests/notebooks/*.py --to ipynb
pytest {posargs:-v} --driver Firefox
pytest {posargs:-v} --reruns 2 --driver Firefox

[testenv:tests-lab-4]
description =
Expand All @@ -56,6 +57,7 @@ setenv =
JUPYTER_DATA_DIR={envdir}/share/jupyter
deps =
pytest<8.0.0
pytest-rerunfailures
pytest-html<4.0.0,
# selenium juypter notebook tests
jupyterlab>=4.0.0
Expand All @@ -73,7 +75,7 @@ deps =
commands =
# converts the python files to ipython notebooks
jupytext tests/notebooks/*.py --to ipynb
pytest {posargs:-v} -m "not matplotlib" --driver Firefox
pytest {posargs:-v} -m "not matplotlib" --reruns 2 --driver Firefox

[testenv:coverage]
# We do coverage in a separate environment that skips the selenium tests but
Expand Down

0 comments on commit da46e85

Please sign in to comment.