【发布时间】:2016-02-29 10:34:30
【问题描述】:
我正在尝试为一个项目编写一个新测试,我只想在 tox 中测试那个测试。我已经完全确定其他测试都很好,我不需要每次都运行它们。我发现的唯一一个 suggestion 不适用
ERROR: InvocationError: could not find executable
【问题讨论】:
我正在尝试为一个项目编写一个新测试,我只想在 tox 中测试那个测试。我已经完全确定其他测试都很好,我不需要每次都运行它们。我发现的唯一一个 suggestion 不适用
ERROR: InvocationError: could not find executable
【问题讨论】:
如jason meridth所写:
$ tox -e py35 -- project/tests/test_file.py::TestClassName::test_method
但是在 cmets 中 beluga.me 提到了细粒度:如果您有 tox.ini 文件,您可能需要添加 {posargs} to pytest in tox.ini:
[tox]
envlist = py35
[testenv]
deps =
pytest
pytest-cov
pytest-pep8
commands =
pip install -e .
pytest {posargs}
python3 -m unittest -q test_file.TestClassName
【讨论】:
【讨论】:
tox -e py27-django18 -- idontexistatall
commands = 没有{posargs},它将忽略您添加到命令中的任何内容。