可以配置pycharm / intellij idea来运行毒性测试吗?我想在独立的py环境中针对不同的python版本测试我的代码。我正在尝试配置它,但到目前为止,我只成功地配置了单个py.test支持。
发布于 2013-01-03 00:43:48
恐怕它不受支持,PyCharm将使用已配置的解释器来运行测试。
欢迎您访问submit a feature request。
发布于 2015-04-25 21:58:16
查看此PyCharm问题:PY-9727
功劳归功于PyCharm的Andrey Vlasovskikh
作为一种解决办法,您可以在项目中创建一个Python文件,用于导入和启动Tox:
import tox
tox.cmdline() 然后通过项目解释器使用其上下文菜单运行此文件。
您将在控制台输出中获得堆栈跟踪的超链接,但仅此而已。
发布于 2020-10-05 00:58:29
7年过去了,现在你可以在PyCharm中运行Tox了。如果你使用pytest进行测试,它甚至会显示测试结果,就像通过PyCharm在本地运行测试一样。
为了在pycharm中运行测试,我使用如下的config
[tox]
envlist = py3.{7,8},codestyle,flake8,lint
minversion = 3.7
[testenv]
usedevelop = true
deps =
pytest
pytest-cov
commands = pytest --cov=src
[testenv:codestyle]
deps = pycodestyle
commands = pycodestyle src tests
[testenv:flake8]
deps = flake8
commands = flake8 src tests
[testenv:lint]
deps = pylint
commands = pylint src tests --rcfile=.pylintrcHere我描述了为什么它看起来是这样的。此外,还有与GitHub CI的集成,以便在每次推送时运行它。
https://stackoverflow.com/questions/14049048
复制相似问题