Skip to content

Commit 67d49a1

Browse files
committed
tests: run in parallel
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 53bf191 commit 67d49a1

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

noxfile.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def tests(session: nox.Session) -> None:
5454
"--cov-config",
5555
"pyproject.toml",
5656
"--cov-report=",
57+
"--numprocesses=auto",
58+
"-m",
59+
"not conda",
5760
*session.posargs,
5861
env={
5962
"COVERAGE_FILE": coverage_file,
@@ -87,7 +90,7 @@ def conda_tests(session: nox.Session) -> None:
8790
# Currently, this doesn't work on Windows either with or without quoting
8891
if not sys.platform.startswith("win32"):
8992
session.conda_install("requests<99")
90-
session.run("pytest", *session.posargs)
93+
session.run("pytest", "-m", "conda", *session.posargs)
9194

9295

9396
@nox.session(venv_backend="mamba", default=shutil.which("mamba"))
@@ -99,7 +102,7 @@ def mamba_tests(session: nox.Session) -> None:
99102
session.install("-e.", "--no-deps")
100103
if not sys.platform.startswith("win32"):
101104
session.conda_install("requests<99")
102-
session.run("pytest", *session.posargs)
105+
session.run("pytest", "-m", "conda", *session.posargs)
103106

104107

105108
@nox.session(venv_backend="micromamba", default=shutil.which("micromamba"))
@@ -112,7 +115,7 @@ def micromamba_tests(session: nox.Session) -> None:
112115
session.install("-e.", "--no-deps")
113116
if not sys.platform.startswith("win32"):
114117
session.conda_install("requests<99")
115-
session.run("pytest", *session.posargs)
118+
session.run("pytest", "-m", "conda", *session.posargs)
116119

117120

118121
@nox.session(default=False)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ test = [
7575
"pytest>=7.4; python_version>='3.12'",
7676
"pytest>=7; python_version<'3.12'",
7777
"pytest-cov>=3",
78+
"pytest-xdist>=3",
7879
]
7980
docs = [
8081
"myst-parser",

requirements-conda-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ httpx
66
jinja2
77
pbs-installer[all]>=2025.1.6
88
pytest
9+
pytest-xdist
910
tox>=4.0.0
1011
virtualenv >=20.14.1

0 commit comments

Comments
 (0)