Skip to content

Commit

Permalink
Update and simplify tox config file to ensure test coverage
Browse files Browse the repository at this point in the history
Surprisingly, having the section [testenv:py39-linux-nodeellip] after
the more generic section
[testenv:py{39,311}-{linux,macos,win}-nodeellip] skip the more specific
section definition.

So the coverage was missed. This can be corrected by putting
[testenv:py39-linux-nodeellip] before [testenv:py{39,311}-{linux,macos,win}-nodeellip]
but this not intuitive.

We choose here to do everything in the main section [testenv] by making
full use of generative names and factor conditions.

In particular, to have a command be used if a given factor is absent, by
using an exclamation mark:

	!nodeellip: ...
  • Loading branch information
nhuet authored and ducoffeM committed Dec 13, 2023
1 parent 292b337 commit f592223
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,22 @@ platform = linux: linux
win: win32
deps =
pytest
deel-lip
commands =
pip uninstall keras keras-nightly -y
pip install keras-nightly
pip list
pytest -v {posargs}
description =
pytest environment

[testenv:py{39,311}-{linux,macos,win}-nodeellip]
deps =
pytest
description =
pytest environment
without deel-lip

[testenv:py39-linux-nodeellip]
# coverage in only one env
deps =
pytest
deel-lip
pytest-cov
!nodeellip: deel-lip
py39-linux-nodeellip: pytest-cov
commands =
pip uninstall keras keras-nightly -y
pip install keras-nightly
pip list
pytest -v \
--cov decomon \
--cov-report xml:coverage.xml \
--cov-report html:coverage_html \
--cov-report term \
{posargs}
py39-linux-nodeellip: --cov decomon \
py39-linux-nodeellip: --cov-report xml:coverage.xml \
py39-linux-nodeellip: --cov-report html:coverage_html \
py39-linux-nodeellip: --cov-report term \
{posargs}
description =
pytest environment
without deel-lip
with coverage
nodeellip: without deel-lip
py39-linux-nodeellip: with coverage

[testenv:pre-commit]
skip_install = true
Expand Down

0 comments on commit f592223

Please sign in to comment.