diff --git a/pyproject.toml b/pyproject.toml index ccd10cb871..77e7d6bf1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ starcraft-hello = "starcraft:hello" [project.optional-dependencies] dev = [ + "coverage[toml]==7.1.0", "pytest==7.2.1", "pytest-cov==4.0.0", "pytest-mock==3.10.0", diff --git a/tox.ini b/tox.ini index 4f7d43f6f9..9c644856ce 100644 --- a/tox.ini +++ b/tox.ini @@ -26,9 +26,10 @@ user_tmp_dir = {env:TMPDIR} env_tmp_dir = {user_tmp_dir:{env:XDG_RUNTIME_DIR:{work_dir}}}/tox_tmp/{env_name} set_env = TMPDIR={env_tmp_dir} + COVERAGE_FILE={env_tmp_dir}/.coverage_{env_name} [test] # Base configuration for unit and integration tests -package = sdist +package = editable extras = dev allowlist_externals = mkdir commands_pre = mkdir -p results @@ -38,9 +39,6 @@ base = testenv, test description = Run unit tests with pytest labels = py38, py310, py311: tests, unit-tests -set_env = - TMPDIR={env_tmp_dir} - COVERAGE_FILE=.coverage_{env_name} commands = pytest {tty:--color=yes} --cov --cov-report=xml:results/coverage-{env_name}.xml --junit-xml=results/test-results-{env_name}.xml tests/unit {posargs} [testenv:integration-{py38,py39,py310,py311,py312}]