diff --git a/.github/workflows/ci_test.yml b/.github/workflows/ci_test.yml index e550e50d4..dc096a29c 100644 --- a/.github/workflows/ci_test.yml +++ b/.github/workflows/ci_test.yml @@ -136,5 +136,5 @@ jobs: python -m pip install --force-reinstall --no-deps . - name: Run tests shell: bash -el {0} - run: pytest -v --pyargs tests + run: pytest -v --pyargs tests --reruns 5 \ No newline at end of file diff --git a/CHANGELOG-unreleased.md b/CHANGELOG-unreleased.md index 7579adb51..575b8ebca 100644 --- a/CHANGELOG-unreleased.md +++ b/CHANGELOG-unreleased.md @@ -20,6 +20,7 @@ the released changes. - When TCB->TDB conversion info is missing, will print parameter name - Piecewise-constant model for chromatic variations (CMX) - `add_param` returns the name of the parameter (useful for numbered parameters) +- Rerun intermittent failures in CI - micromamba CI environment for testing macOS-latest, without tox ### Fixed - Changed WAVE_OM units from 1/d to rad/d. diff --git a/requirements_dev.txt b/requirements_dev.txt index de85bbaca..be6046e27 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -11,6 +11,8 @@ wheel>=0.29.0 pytest>=4.3 pytest-cov>=2.7.1 pytest-runner>=5.1 +pytest-xdist +pytest-rerunfailures flake8>=3.7 pep8-naming>=0.8.2 flake8-docstrings>=1.4 @@ -37,4 +39,3 @@ loguru # click<=8.0.4 gprof2dot py-cpuinfo -pytest-xdist diff --git a/tox.ini b/tox.ini index 60f8fa754..4e19b0fda 100644 --- a/tox.ini +++ b/tox.ini @@ -37,14 +37,15 @@ deps = cov: coverage cov: pytest-cov cov: pytest-remotedata + pytest-rerunfailures hypothesis numdifftools pathos setuptools commands = pip freeze - !cov: pytest - cov: pytest -v --pyargs tests --cov=pint --cov-config={toxinidir}/.coveragerc {posargs} + !cov: pytest --reruns 5 + cov: pytest -v --pyargs tests --cov=pint --cov-config={toxinidir}/.coveragerc {posargs} --reruns 5 cov: coverage xml -o {toxinidir}/coverage.xml depends = @@ -88,9 +89,11 @@ deps = matplotlib==3.4.3 scipy==1.9.0 pytest + pytest-rerunfailures coverage hypothesis<=6.72.0 -commands = {posargs:pytest} +commands = + pytest --reruns 5 [testenv:report] skip_install = true