diff --git a/tox.ini b/tox.ini index 7eadadbb..d3d29915 100644 --- a/tox.ini +++ b/tox.ini @@ -33,9 +33,8 @@ install_command = python -Im pip install --no-compile {opts} {packages} set_env = COVERAGE_PROCESS_START={toxinidir}/pyproject.toml PYTHONWARNINGS=d -commands = - python -c 'f = open("{env_site_packages_dir}/cov.pth", "w"); f.write("import coverage; coverage.process_startup()"); f.close()' - coverage run -m pytest {posargs:-n auto} +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} [testenv:coverage-report]