From 807d7dec083751ef767edeb2cc73800124d16ec4 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Sun, 29 Oct 2023 14:09:36 +0100 Subject: [PATCH] Use pytest-xdist and 2 workers on CI when running the test suite --- .github/workflows/tests.yml | 2 +- pyproject.toml | 6 +++++- setup.py | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f5f49217..6f1e9ba53 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,7 +45,7 @@ jobs: - name: Run test suite run: | - pytest --pyargs exspy + pytest --pyargs exspy -n 2 - name: Upload coverage to Codecov if: ${{ always() }} diff --git a/pyproject.toml b/pyproject.toml index fb58f9eb1..99ed3d685 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,8 @@ force-exclude = ''' exspy/misc/eds/ffast_mac.py | exspy/misc/elements.py -''' \ No newline at end of file +''' + +[tool.pytest.ini_options] +addopts = "-ra -n auto --dist loadfile" +testpaths = ["hyperspy/tests", ] diff --git a/setup.py b/setup.py index b6de47b6b..50a330c82 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ "pytest >= 5.0", "pytest-mpl", "pytest-cov >= 2.8.1", + "pytest-xdist", ], "dev": ["black", "pre-commit >=1.16"], }