pytest results in "Unable to attach test reporter" error in PyCharm EAP 3.0

I've got a web2py project that I've created unit tests for. I keep the unit tests in a directory called tests, whereas the code I'm testing is under the standard modules directory:
/tagpoc (project root)
    /web2py 
        /applications
            /tagpoc (web2py app. root)
 /modules
     projmod.py
 /tests
     test_projmod.py
prettyPrint();
I've configured pytest in Preferences->Python Integrated Tools. In the Edit Configuration dialog, I've tried specifying the /tagpoc directory in the working directory option (I can run pytest from the cmdline successfully from this directory, albeit only after I set PYTHONPATH=$PYTHONPATH:`pwd`).

When I run the test, I receive an Unable to attach test reporter to test framework or test framework quit unexpectedly in the left side of the tool window and the following trace in the right:

/Users/chb/.virtualenvs/tagPoc/bin/python "/Applications/PyCharm 3.0 EAP.app/helpers/pycharm/pytestrunner.py" -p pytest_teamcity /Users/chb/code/tagpoc/web2py/applications/tagpoc/tests/test_projmod.py
Testing started at 6:31 PM ...
Traceback (most recent call last):
  File "/Applications/PyCharm 3.0 EAP.app/helpers/pycharm/pytestrunner.py", line 51, in <module>
    main()
  File "/Applications/PyCharm 3.0 EAP.app/helpers/pycharm/pytestrunner.py", line 24, in main
    pluginmanager=_pluginmanager, args=args)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 441, in __call__
    return self._docall(methods, kwargs)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 452, in _docall
    res = mc.execute()
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 370, in execute
    res = method(**kwargs)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/helpconfig.py", line 25, in pytest_cmdline_parse
    config = __multicall__.execute()
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 370, in execute
    res = method(**kwargs)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/config.py", line 10, in pytest_cmdline_parse
    config.parse(args)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/config.py", line 373, in parse
    self._preparse(args)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/config.py", line 348, in _preparse
    self.pluginmanager.consider_preparse(args)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 183, in consider_preparse
    self.consider_pluginarg(opt2)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 193, in consider_pluginarg
    self.import_plugin(arg)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 213, in import_plugin
    mod = importplugin(modname)
  File "/Users/chb/.virtualenvs/tagPoc/lib/python2.7/site-packages/_pytest/core.py", line 349, in importplugin
    __import__(importspec)
  File "/Applications/PyCharm 3.0 EAP.app/helpers/pycharm/pytest_teamcity.py", line 3, in <module>
    helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
NameError: name 'sys' is not defined

Process finished with exit code 1
prettyPrint();

What am I doing wrong?

PyCharm 3.0 EAP (130.1058)
Python 2.7.5
pytest 2.3.5
1 comment
That's a bug in PyCharm; we'll fix it in the next update build. Thanks for the information!
0

Please sign in to leave a comment.