diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 0f2a0522..6c224624 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -45,7 +45,7 @@ jobs: options: "--check --verbose" - name: Run unit tests - run: PYTHONPATH=test python -m pytest test/ + run: PYTHONPATH=test pytest -n auto test/ env: COVERAGE_FILE: ".coverage.${{ matrix.python_version }}" diff --git a/pyproject.toml b/pyproject.toml index 5cf9e031..e49f4dac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ dev = [ "pytest==7.4.2", "pytest-cov==4.1.0", "pytest-helpers-namespace==2021.12.29", + "pytest-xdist==3.3.1" ] [tool.setuptools.packages.find] diff --git a/test/conftest.py b/test/conftest.py index 974cce1c..d7a11f70 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -402,4 +402,5 @@ def pytest_sessionstart(session): def pytest_sessionfinish(session, exitstatus): - shutil.rmtree(TEST_WORKING_DIRECTORY) + if os.path.exists(TEST_WORKING_DIRECTORY): + shutil.rmtree(TEST_WORKING_DIRECTORY)