我有一个非常简单的测试脚本只是为了学习pytest,tmp.py:
def square(x):
return x*x
def test_square():
assert square(4) == 16
使用 Pycharm 运行此脚本,我已经配置了我的项目设置,以便将 pytest 用作我的默认测试运行器。当我运行上面的代码时,我收到以下错误:
/Users/mingxiao/webdav_2.7.5/bin/python /Applications/PyCharm.app/helpers/pycharm/pytestrunner.py -p pytest_teamcity /Users/mingxiao/dev/juggernaut/src/integrations/webDAV/demo/tmp.py "-k test_square"
Testing started at 4:41 PM ...
Traceback (most recent call last):
File "/Applications/PyCharm.app/helpers/pycharm/pytestrunner.py", line 51, in <module>
main()
File "/Applications/PyCharm.app/helpers/pycharm/pytestrunner.py", line 20, in main
_pluginmanager = PluginManager(load=True)
TypeError: __init__() got an unexpected keyword argument 'load'
Process finished with exit code 1
我正在运行 PyCharm 3.0 专业版、pytest 2.4.2 和 python 2.7.5。似乎是它的 PyCharm 本身导致了这个问题。