Skip to content

Commit

Permalink
tools: improve coverage support in the tox test environments (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored Feb 13, 2023
1 parent 679c20f commit 2aaed7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}]
Expand Down

0 comments on commit 2aaed7e

Please sign in to comment.