2013-10-07 6 views
8

pytestrunner의 PluginManager를 예기치 않은 키워드 인수가 단지 pytest, tmp.py 배우 :이 스크립트를 실행 Pycharm를 사용pycharm 내가 아주 간단한 테스트 스크립트를

def square(x): 
    return x*x 
def test_square(): 
    assert square(4) == 16 

을, 나는 pytest이되도록 설정 내 프로젝트를 구성한 내 기본 테스트 러너로 사용됩니다. 내가 PyCharm 3.0 프로페셔널 에디션을 실행하고

/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 

, pytest 2.4.2 및 파이썬 2.7.5 : 나는 위의 코드를 실행하면 나는 다음과 같은 오류가 발생합니다. PyCharm 자체가 문제를 일으키는 것 같습니다.

+0

작동합니다. –

답변

11

PyCharm과 py.test 2.4.x 사이에 호환되지 않는 것으로 보입니다. py.test 2.3.5 (예 : pip install pytest==2.3.5)를 설치하면 정상적으로 작동합니다. JetBrains에 버그 보고서를 제출하는 것이 좋습니다.

+0

PyCharms가 문제를 해결하지 않았다면 pytest 문제 추적기에 문제를 제기하십시오. 내가 생각하기에 쉬운 수정이다. – hpk42

2

PyCharm의 pytest 도우미가 새로운 pytest와 호환 될 것 같지 않습니다 pycharm 추적기 만들었습니다. 문제가 해결 될 때까지 py.test 스크립트의 내용으로 바꾸면됩니다.

도우미가 PyCharm.app/helpers/pycharm/pytestrunner.py에 있습니다 (테스트를 실행하려고하면이 경로를 볼 수 있습니다). PyCharm에 의해 프로젝트에 pytest를 추가에서

__requires__ = 'pytest==2.5.1' 
    import sys 
    from pkg_resources import load_entry_point 

    if __name__ == '__main__': 
     sys.exit(
      load_entry_point('pytest==2.5.1', 'console_scripts', 'py.test')() 
    ) 
0

: 그냥 나를 위해 그것이, 그것에서 cat `which py.test`의 출력을 넣어 설정 -> 프로젝트 인터프리터 -> 더하기 녹색 아이콘을 클릭 -> "pytests"에 대한 검색 ->은 "패키지를 설치"버튼

다시 실행을 클릭합니다, 지금은 그것은 마지막에 * s의의 *로 PyCharm있어

관련 문제