如何为每个环境使用一个testenv,而不是一个tox?

时间:2019-09-09 16:11:55

标签: python pytest tox

我有以下tox.ini文件:

[tox]
envlist = py{27,34,35,36,37},flake8

[testenv]
changedir = {toxworkdir}/{envname}
deps =
    pytest-cov
    pytest
setenv =
    COVERAGE_FILE = {toxinidir}/.coverage.{envname}
commands =
    pytest {toxinidir}/tests --cov=SOME_DIRECTORY --cov-report=html:{toxinidir}/coverage_html_report/{envname} {posargs}

[testenv:flake8]
basepython = python3
skip_install = true
deps = flake8
commands = flake8 src tests

[flake8]
ignore: F401,E402,W503,W291,E501,W605

我希望仅对testenv而不是py{27,34,35,36,37}运行第一个flake8。我尝试做[testenv:py{27,34,35,36,37}],但是它确实改变了testenv内命令的行为(pytest命令未运行)。

如何指定[testenv]中当前的代码仅针对py{27,34,35,36,37}运行?

0 个答案:

没有答案