我正在尝试为一个项目编写一个新测试,我只想在 tox 中测试那个测试。我已经完全确定其他测试没问题,我不需要每次都运行它们。唯一suggestion我发现不适用于
ERROR: InvocationError: could not find executable
最佳答案
由 jason meridth 撰写:
$ tox -e py35 -- project/tests/test_file.py::TestClassName::test_method
但是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}
使用 unittest 运行一个测试
python3 -m unittest -q test_file.TestClassName
关于python - 如何在 tox 中只运行一个测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35697353/