INTERNALERROR when running py.test in 2016.2.1 (works fine in 2016.1.4)

Answered

Since updating PyCharm to 2016.2.1 on my Ubuntu 16.4 machine I cannot run tests in my project. The tests still work fine in Pycharm 2016.1.4 on the same machine.

Here's the full stack trace (I redacted file, class and method names: 

 

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/main.py", line 90, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/main.py", line 121, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/xdist/dsession.py", line 521, in pytest_runtestloop
INTERNALERROR> self.loop_once()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/xdist/dsession.py", line 539, in loop_once
INTERNALERROR> call(**kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/xdist/dsession.py", line 577, in slave_slavefinished
INTERNALERROR> assert not crashitem, (crashitem, node)
INTERNALERROR> AssertionError: ('<filename>.py::<classname>::<methodname>', <SlaveController gw1>)

 

Any Ideas? Should this be reported as a bug?

2
9 comments
Official comment

Hi.

Please contact JetBrains support and provide project to reproduce for further assistance.

Does it work from terminal? Can you provide screenshot of your run confguration?

0
Avatar
Permanently deleted user

It does work from terminal. Running

python -m pytest ./<name of testfile>.py

gives me all passing tests.

Here's a screenshot of my run configuration from within PyCharm 2016.2.1:

1

Just to make sure: can you run it with ``py.test`` tool instead of running module directly?

We need to compare ENV and sys.path variables availavble to python when running from py.test and from PyCharm.

Can you add something like pprint(sys.path) and pprint(os.environ) ?

0

The request was redirected to Zendesk.

0
Avatar
Permanently deleted user

I just encountered this same issue in PyCharm 2016.2.2 on kubuntu 16.4.  The tests run fine outside of PyCharm.  I can provide environment variables but don't want to do so publicly here. Where should I send them?

0

Hello Bruce. Please upload project to http://uploads.jetbrains.com and post filename here. Only JetBrains employee will be able to download this file.

0
Avatar
Permanently deleted user

Ilya, I was finally able to get back to this ticket and have a much simpler way to reproduce. I confirmed this is broken on Ubuntu and OSX:

1. create any basic pytest file:

```
def test(): 
  assert True
```
2. install pytest and pytest-xdist
3. run py.test with the additional option of -n2 (to use xdist)

Output:

```

============================= test session starts ==============================
platform linux2 -- Python 2.7.12, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: /circleup/packages/python-sandbox, inifile:
plugins: xdist-1.15.0
gw0 I / gw1 I
gw0 [1] / gw1 [1]

scheduling tests via LoadScheduling
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/main.py", line 96, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/main.py", line 131, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/xdist/dsession.py", line 536, in pytest_runtestloop
INTERNALERROR> self.loop_once()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/xdist/dsession.py", line 555, in loop_once
INTERNALERROR> call(**kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/xdist/dsession.py", line 593, in slave_slavefinished
INTERNALERROR> assert not crashitem, (crashitem, node)
INTERNALERROR> AssertionError: ('tests.py::test_one', <SlaveController gw0>)
INTERNALERROR> assert not 'tests.py::test_one'
```

0

Please sign in to leave a comment.