是否可以 运行 在 tox 中广度优先而不是深度优先?
Is it possible to run breadth first instead of depth first in tox?
我有一套小型测试总共需要大约 40 秒才能达到 运行,我有一套中型测试总共需要大约 40 分钟才能达到 运行。
我喜欢这样订购 运行:
- py27 小测试
- py37 小测试
- py27 中等测试
- py37 中等测试
相反,tox 运行就像
- py27 小测试
- py27 中等测试
- py37 小测试
- py37 中等测试
问题是如果一些简单的事情破坏了一个小测试,我想立即了解它。中等测试(如集成测试)是一个额外的安全层,可以排除更多问题,但需要更长的时间 运行 通过。
[tox]
envlist = py27,py37
[testenv:py27]
deps =
pytest
pytest-cov
pytest-mock
pylint
; packages specified by the setup.py cover the other dependencies for py2.7
commands =
pytest -v --ignore-glob="*medium*" --doctest-modules
pytest -v tests/medium_tests
我不是毒物专家,但这样的事情可能会有所帮助:
[tox]
envlist = {s,m}-{py27,py37}
[testenv]
deps =
pytest
commands =
s: pytest -v -k 'not medium'
m: pytest -v -k 'medium'
你所有的短测试命令都应该有前缀s:
,所有中等测试命令都有前缀m:
重要的是 env 列表 {s,m}-{py27,py37}
它将 运行 到 s-py27
、s-py37
、m-py27
、m-py37
的顺序。
我有一套小型测试总共需要大约 40 秒才能达到 运行,我有一套中型测试总共需要大约 40 分钟才能达到 运行。
我喜欢这样订购 运行:
- py27 小测试
- py37 小测试
- py27 中等测试
- py37 中等测试
相反,tox 运行就像
- py27 小测试
- py27 中等测试
- py37 小测试
- py37 中等测试
问题是如果一些简单的事情破坏了一个小测试,我想立即了解它。中等测试(如集成测试)是一个额外的安全层,可以排除更多问题,但需要更长的时间 运行 通过。
[tox]
envlist = py27,py37
[testenv:py27]
deps =
pytest
pytest-cov
pytest-mock
pylint
; packages specified by the setup.py cover the other dependencies for py2.7
commands =
pytest -v --ignore-glob="*medium*" --doctest-modules
pytest -v tests/medium_tests
我不是毒物专家,但这样的事情可能会有所帮助:
[tox]
envlist = {s,m}-{py27,py37}
[testenv]
deps =
pytest
commands =
s: pytest -v -k 'not medium'
m: pytest -v -k 'medium'
你所有的短测试命令都应该有前缀s:
,所有中等测试命令都有前缀m:
重要的是 env 列表 {s,m}-{py27,py37}
它将 运行 到 s-py27
、s-py37
、m-py27
、m-py37
的顺序。