Skip to content

Commit 1dfd148

Browse files
committed
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.
1 parent b78abad commit 1dfd148

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ set_env =
3434
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
3535
PYTHONWARNINGS=d
3636
commands_pre = python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")'
37-
commands = coverage run -m pytest {posargs:-n auto}
37+
# We group xdist execution by file because otherwise the Mypy tests have race conditions.
38+
commands = coverage run -m pytest {posargs:-n auto --dist loadfile}
3839

3940
[testenv:coverage-report]
4041
# Keep base_python in-sync with .python-version-default

0 commit comments

Comments
 (0)