Skip to content

Commit 30cd0e0

Browse files
authored
Speed up tests with pytest-xdist (#114)
* added pytest-xdist dependency and automatic use of -n auto * disabled automatic multithreading in local tests, and enabled it when running github tests action
1 parent 3505484 commit 30cd0e0

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ jobs:
3636
pip install '.[test]'
3737
- name: Run the tests with pytest
3838
run: |
39-
python -m pytest --cov=posteriors --cov-report term-missing
39+
python -m pytest -n auto --cov=posteriors --cov-report term-missing

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ classifiers = [
1717
dependencies = ["torch>=2.0.0", "torchopt>=0.7.3", "optree>=0.10.0"]
1818

1919
[project.optional-dependencies]
20-
test = ["pre-commit", "pytest-cov", "ruff"]
20+
test = ["pre-commit", "pytest-cov", "pytest-xdist", "ruff"]
2121
docs = ["mkdocs", "mkdocs-material", "mkdocstrings[python]"]
2222

2323
[tool.setuptools]
@@ -33,6 +33,7 @@ packages = [
3333
[tool.ruff.lint.per-file-ignores]
3434
"__init__.py" = ["F401", "F821", "E402"]
3535

36+
3637
[build-system]
3738
requires = ["setuptools>=64"]
3839
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)