diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8cec6a63d7..b4438055c0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -136,7 +136,11 @@ jobs: - name: Test with pytest run: | - python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0|| exit_code=$? + # run in parallel with xdist if not test_modules.py or test_subworkflows.py + if [ "${{ matrix.test }}" != "test_modules.py" ] && [ "${{ matrix.test }}" != "test_subworkflows.py" ]; then + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 -n 2 && exit_code=0|| exit_code=$? + else + python3 -m pytest tests/${{matrix.test}} --color=yes --cov --durations=0 && exit_code=0|| exit_code=$? # don't fail if no tests were collected, e.g. for test_licence.py if [ "${exit_code}" -eq 5 ]; then echo "No tests were collected"