From 7c264ad4a5aa39833bdad8b50c93de92422f0784 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Mon, 26 Jun 2023 18:09:43 +0200 Subject: [PATCH] Split out pre command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bernát Gábor <690238+gaborbernat@users.noreply.github.com> --- tox.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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]