This is an automated email from the ASF dual-hosted git repository.

hcr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git


The following commit(s) were added to refs/heads/main by this push:
     new 98602f1b8 test: add pytest-xdist to speed up tests (#1142)
98602f1b8 is described below

commit 98602f1b81f8dd0270eaa96d4e91bd21f56ed271
Author: Tim Hsiung <[email protected]>
AuthorDate: Sun Mar 8 01:02:31 2026 +0800

    test: add pytest-xdist to speed up tests (#1142)
---
 .github/workflows/python-build.yml   |  2 +-
 .github/workflows/python-testing.yml |  2 +-
 Makefile                             |  2 +-
 pyproject.toml                       |  1 +
 uv.lock                              | 24 ++++++++++++++++++++++++
 5 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/python-build.yml 
b/.github/workflows/python-build.yml
index 88c4892fa..77f420fc8 100644
--- a/.github/workflows/python-build.yml
+++ b/.github/workflows/python-build.yml
@@ -42,7 +42,7 @@ jobs:
           sccache: true
 
       - run: uv pip install torch --index-url 
https://download.pytorch.org/whl/cpu
-      - run: uv run pytest testing/ -v
+      - run: uv run pytest -n auto testing/ -v
       - run: uv build
 
       - uses: PyO3/maturin-action@v1
diff --git a/.github/workflows/python-testing.yml 
b/.github/workflows/python-testing.yml
index ff6733f21..c76c60140 100644
--- a/.github/workflows/python-testing.yml
+++ b/.github/workflows/python-testing.yml
@@ -53,4 +53,4 @@ jobs:
         run: uv sync --group dev
 
       - name: Run tests
-        run: uv run pytest testing/ -v
+        run: uv run pytest -n auto testing/ -v
diff --git a/Makefile b/Makefile
index e32837c9d..c9c58f0bd 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ ifeq ($(HAS_NVIDIA),yes)
 else
        @echo "[SKIP] No NVIDIA GPU detected, skipping maturin develop"
 endif
-       uv run pytest --cov=qumat --cov=qumat_qdp --cov-report=term-missing 
--cov-report=html:htmlcov
+       uv run pytest -n auto --cov=qumat --cov=qumat_qdp 
--cov-report=term-missing --cov-report=html:htmlcov
 tests: test_rust test_python
 
 pre-commit: setup-test-python
diff --git a/pyproject.toml b/pyproject.toml
index 1a409e35c..5c4067ce1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -52,6 +52,7 @@ qdp = ["qumat-qdp"]
 [dependency-groups]
 dev = [
     "pytest>=9.0.1",
+    "pytest-xdist>=3.8.0",
     "ruff>=0.13.1",
     "ty>=0.0.16",
     "pre-commit>=3.0.0",
diff --git a/uv.lock b/uv.lock
index 2c3c56801..a89d21407 100644
--- a/uv.lock
+++ b/uv.lock
@@ -597,6 +597,15 @@ wheels = [
     { url = 
"https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl";,
 hash = 
"sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size 
= 16740, upload-time = "2025-11-21T23:01:53.443Z" },
 ]
 
+[[package]]
+name = "execnet"
+version = "2.1.2"
+source = { registry = "https://pypi.org/simple"; }
+sdist = { url = 
"https://files.pythonhosted.org/packages/bf/89/780e11f9588d9e7128a3f87788354c7946a9cbb1401ad38a48c4db9a4f07/execnet-2.1.2.tar.gz";,
 hash = 
"sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd", size 
= 166622, upload-time = "2025-11-12T09:56:37.75Z" }
+wheels = [
+    { url = 
"https://files.pythonhosted.org/packages/ab/84/02fc1827e8cdded4aa65baef11296a9bbe595c474f0d6d758af082d849fd/execnet-2.1.2-py3-none-any.whl";,
 hash = 
"sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec", size 
= 40708, upload-time = "2025-11-12T09:56:36.333Z" },
+]
+
 [[package]]
 name = "filelock"
 version = "3.20.3"
@@ -1870,6 +1879,19 @@ wheels = [
     { url = 
"https://files.pythonhosted.org/packages/ee/49/1377b49de7d0c1ce41292161ea0f721913fa8722c19fb9c1e3aa0367eecb/pytest_cov-7.0.0-py3-none-any.whl";,
 hash = 
"sha256:3b8e9558b16cc1479da72058bdecf8073661c7f57f7d3c5f22a1c23507f2d861", size 
= 22424, upload-time = "2025-09-09T10:57:00.695Z" },
 ]
 
+[[package]]
+name = "pytest-xdist"
+version = "3.8.0"
+source = { registry = "https://pypi.org/simple"; }
+dependencies = [
+    { name = "execnet" },
+    { name = "pytest" },
+]
+sdist = { url = 
"https://files.pythonhosted.org/packages/78/b4/439b179d1ff526791eb921115fca8e44e596a13efeda518b9d845a619450/pytest_xdist-3.8.0.tar.gz";,
 hash = 
"sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1", size 
= 88069, upload-time = "2025-07-01T13:30:59.346Z" }
+wheels = [
+    { url = 
"https://files.pythonhosted.org/packages/ca/31/d4e37e9e550c2b92a9cbc2e4d0b7420a27224968580b5a447f420847c975/pytest_xdist-3.8.0-py3-none-any.whl";,
 hash = 
"sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88", size 
= 46396, upload-time = "2025-07-01T13:30:56.632Z" },
+]
+
 [[package]]
 name = "python-dateutil"
 version = "2.9.0.post0"
@@ -2016,6 +2038,7 @@ dev = [
     { name = "pre-commit" },
     { name = "pytest" },
     { name = "pytest-cov" },
+    { name = "pytest-xdist" },
     { name = "ruff" },
     { name = "setuptools" },
     { name = "tensorflow" },
@@ -2042,6 +2065,7 @@ dev = [
     { name = "pre-commit", specifier = ">=3.0.0" },
     { name = "pytest", specifier = ">=9.0.1" },
     { name = "pytest-cov", specifier = ">=7.0.0" },
+    { name = "pytest-xdist", specifier = ">=3.8.0" },
     { name = "ruff", specifier = ">=0.13.1" },
     { name = "setuptools", specifier = ">=80.9.0" },
     { name = "tensorflow", specifier = ">=2.20" },

Reply via email to