diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43363e94..191a5854 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,9 +10,6 @@ on: workflow_dispatch: workflow: '*' -env: - MPLBACKEND: agg - jobs: code: name: code style @@ -53,6 +50,9 @@ jobs: name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }} runs-on: ${{ matrix.os }} timeout-minutes: 15 + env: + MPLBACKEND: agg + PYTEST_ARGS: --pyargs kikuchipy --reruns 2 -n 2 --cov=kikuchipy strategy: fail-fast: false matrix: @@ -120,12 +120,12 @@ jobs: run: | sudo apt-get update sudo apt-get install xvfb - xvfb-run pytest -n 2 --cov=kikuchipy --pyargs kikuchipy + xvfb-run pytest ${{ env.PYTEST_ARGS }} - name: Run tests on Windows or macOS if: ${{ matrix.os != 'ubuntu-latest' }} run: | - pytest -n 2 --cov=kikuchipy --pyargs kikuchipy + pytest ${{ env.PYTEST_ARGS }} - name: Generate line coverage run: | diff --git a/setup.py b/setup.py index 29e25c8f..8068f335 100644 --- a/setup.py +++ b/setup.py @@ -63,6 +63,7 @@ "pytest >= 5.4", "pytest-benchmark", "pytest-cov >= 2.8.1", + "pytest-rerunfailures", "pytest-xdist", ], "all": [