python - 我如何在 Eclipse 中的 pytest 中运行特定的参数化测试用例

标签 python eclipse pydev pytest liclipse

虽然PyDev支持py.test运行器,但运行时parametric-tests ,无法在 PyUnit View 中运行特定的测试用例。

通常,在 PyUnit View 中的测试用例上右键单击并运行会重新启动它 - 但在这种情况下,什么也没有发生,并且控制台记录:

============================= test session starts =============================
platform win32 -- Python 3.6.1, pytest-3.2.1, py-1.4.33, pluggy-0.4.0
rootdir: D:\project, inifile:
collected 23 items

======================== no tests ran in 0.04 seconds =========================

(请注意,我仅在 Windows 上尝试过)

最佳答案

不支持在 PyDev 中运行单个参数失败的测试用例(并且也无法真正想出一种方法来使其工作)。

因此,您必须运行测试,该测试将在传递所有参数的情况下运行它(即:使用 Ctrl+Shift+Up/Ctrl+Shift+Down在编辑器中选择测试,然后使用 Ctrl+F9 仅运行该测试)。

关于python - 我如何在 Eclipse 中的 pytest 中运行特定的参数化测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48507122/

相关文章:

python绑定(bind),它是如何工作的?

javascript - 将 django 变量传递给 javascript

java - Eclipse 无法识别生成的类

python - 从 djangoviews.py 中找不到 Matlab 脚本

django - 如何使用 Eclipse 和 Pydev 正确调试?

python - Tensorflow 图像对象位置

python - 使用 python django-dashing 从 MySQL 提取数据以显示在仪表板上

java - Eclipse WindowBuilder 设计选项卡为空?

c++ - 如何解决 Eclipse CDT 中 C++ 文件中的 "Unresolved inclusion: <iostream>"?

python - 在 PyDev 中查看 Python egg 文件中的代码