Skip to content

Commit

Permalink
Make the main py3 tox environment an alias/merge of other test enviro…
Browse files Browse the repository at this point in the history
…nments

Having tox call tox is a bit weird, but the alternatives are:
 - duplication of the test command, which is a bit sad
 - replacing all the positive factors with conjunction of negative factors, e.g.
   `core` -> `!db-!server`, which makes the logic painful to follow

One day, tox will have environment aliases which will make this horror moot :-)

(Idea pulled from a comment in tox-dev/tox#427)
  • Loading branch information
olasd committed Nov 21, 2019
1 parent 6f27106 commit b390204
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,21 @@ deps =
db: .[db]
db: pifpaf
server: .[http]
cover: pytest-cov
commands =
db: pifpaf run postgresql -- \
pytest --doctest-modules \
slow: --hypothesis-profile=slow \
cover: --cov={envsitepackagesdir}/swh/core --cov-branch \
core: {envsitepackagesdir}/swh/core/tests \
db: {envsitepackagesdir}/swh/core/db/tests \
server: {envsitepackagesdir}/swh/core/api/tests \
{posargs}

[testenv:py3]
deps =
.[testing]
pytest-cov
pifpaf
commands =
pifpaf run postgresql -- \
pytest --doctest-modules \
--hypothesis-profile=slow \
--cov={envsitepackagesdir}/swh/core --cov-branch \
{envsitepackagesdir}/swh/core {posargs}
skip_install = true
deps = tox
commands = tox -e py3-core-db-server-slow-cover -- {posargs}

[testenv:flake8]
skip_install = true
Expand Down

0 comments on commit b390204

Please sign in to comment.