From 1dfd14856bc1cf557519fa8289f0c1ca4e743e9a Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Thu, 1 Aug 2024 07:05:59 +0200 Subject: [PATCH] Limit xdist distribution to files I get regularly spurious failures in tox in the Mypy tests because of being able to access certain files. I hope running the file non-concurently helps here. --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 42cb6c67..68e3f5a8 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,8 @@ set_env = COVERAGE_PROCESS_START={toxinidir}/pyproject.toml PYTHONWARNINGS=d commands_pre = python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")' -commands = coverage run -m pytest {posargs:-n auto} +# We group xdist execution by file because otherwise the Mypy tests have race conditions. +commands = coverage run -m pytest {posargs:-n auto --dist loadfile} [testenv:coverage-report] # Keep base_python in-sync with .python-version-default