【发布时间】:2017-05-14 23:11:55
【问题描述】:
我是单元测试的新手,“我试图在 Eclipse 上运行 pytest。我已经搜索了几个小时,但我似乎无法找出问题所在。我在玩一些简单的例子https://pytest.org 网站。我的问题是 pytest 不能在 Eclipse 上运行。我可以使用命令提示符进行测试,但我更希望在控制台窗口上显示结果。
我尝试过但没用的东西;
- 将
PyUnit测试运行器设置为Py.test运行器(而不是默认的Pydev 测试运行器)
在这种情况下,我收到以下错误消息
用法:runfiles.py [选项] [file_or_dir] [file_or_dir] [...] runfiles.py:错误:无法识别的参数:--verbosity inifile: 无 rootdir: C:\peepee\pytest\testing
- 我已将详细程度设置为 9(在某处读取它的最大值)。没有任何区别。
我正在尝试从http://pytest.org 网站测试的简单代码
def func(x):
return x + 1
def test_answer():
assert func(3) == 5
通过 cmd 工作,但不能在 Eclipse 上工作。
请帮忙,因为我正在浪费时间试图解决这个问题。提前致谢
【问题讨论】:
标签: python eclipse unit-testing pytest