Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest-xdist appears to fail on Python 3.5 #1007

Closed
Lukasa opened this issue Sep 15, 2015 · 4 comments
Closed

pytest-xdist appears to fail on Python 3.5 #1007

Lukasa opened this issue Sep 15, 2015 · 4 comments

Comments

@Lukasa
Copy link

Lukasa commented Sep 15, 2015

OS: Mac OS X 10.11 El Capitan GM
Python: 3.5.0, from pyenv
py.test version: 2.7.3

I'm testing a project on Python 3.5 with pytest-xdist, pytest-cov, and hypothesis-pytest. Using pytest-xdist is causing unexpected breakages on Python 3.5 only: no problems are encountered in other pythons, or if I disable pytest-xdist.

Below is the successful output from running py.test test/:

(py35)cory@corymbp:hyper-h2/ % py.test test/
============================= test session starts ==============================
platform darwin -- Python 3.5.0 -- py-1.4.30 -- pytest-2.7.3
rootdir: /Users/cory/Documents/Python/hyper-h2, inifile: 
plugins: hypothesis-pytest, cov, xdist, xdist, xdist
collected 96 items 

test/test_basic_logic.py .....................................................................................
test/test_events.py ...
test/test_invalid_frame_sequences.py ..
test/test_state_machines.py ......

========================== 96 passed in 2.07 seconds ===========================

Below is the unsuccessful output from running py.test -n 4 test/ (truncated because it just repeats forever):

============================ test session starts ==============================
platform darwin -- Python 3.5.0 -- py-1.4.30 -- pytest-2.7.3
rootdir: /Users/cory/Documents/Python/hyper-h2, inifile: 
plugins: hypothesis-pytest, cov, xdist, xdist, xdist
gw0 C / gw1 C / gw2 C / gw3 C[gw0] node down: Traceback (most recent call last):
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/enum/__init__.py", line 371, in __getattr__
    return cls._member_map_[name]
KeyError: '_convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/execnet/gateway_base.py", line 1072, in executetask
    do_exec(co, loc)  # noqa
  File "<string>", line 1, in do_exec
  File "<remote exec>", line 143, in <module>
  File "<remote exec>", line 120, in remote_initconfig
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 673, in fromdictargs
    pluginmanager = get_plugin_manager()
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 67, in get_plugin_manager
    pluginmanager.import_plugin(spec)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 332, in import_plugin
    self.register(mod, modname)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 189, in register
    reg(plugin, name)  # may call addhooks
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 612, in _register_plugin
    import pytest
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/pytest.py", line 17, in <module>
    _preloadplugins() # to populate pytest.* namespace so help(pytest) works
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 58, in _preloadplugins
    _preinit.append(get_plugin_manager())
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 67, in get_plugin_manager
    pluginmanager.import_plugin(spec)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 318, in import_plugin
    mod = importplugin(modname)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 367, in importplugin
    __import__(mod)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/pdb.py", line 3, in <module>
    import pdb
  File "/Users/cory/.pyenv/versions/3.5.0/lib/python3.5/pdb.py", line 78, in <module>
    import signal
  File "/Users/cory/.pyenv/versions/3.5.0/lib/python3.5/signal.py", line 8, in <module>
    _IntEnum._convert(
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/enum/__init__.py", line 373, in __getattr__
    raise AttributeError(name)
AttributeError: _convert

Replacing crashed slave gw0
gw4 C / gw1 C / gw2 C / gw3 C[gw1] node down: Traceback (most recent call last):
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/enum/__init__.py", line 371, in __getattr__
    return cls._member_map_[name]
KeyError: '_convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/execnet/gateway_base.py", line 1072, in executetask
    do_exec(co, loc)  # noqa
  File "<string>", line 1, in do_exec
  File "<remote exec>", line 143, in <module>
  File "<remote exec>", line 120, in remote_initconfig
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 673, in fromdictargs
    pluginmanager = get_plugin_manager()
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 67, in get_plugin_manager
    pluginmanager.import_plugin(spec)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 332, in import_plugin
    self.register(mod, modname)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 189, in register
    reg(plugin, name)  # may call addhooks
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 612, in _register_plugin
    import pytest
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/pytest.py", line 17, in <module>
    _preloadplugins() # to populate pytest.* namespace so help(pytest) works
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 58, in _preloadplugins
    _preinit.append(get_plugin_manager())
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 67, in get_plugin_manager
    pluginmanager.import_plugin(spec)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 318, in import_plugin
    mod = importplugin(modname)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 367, in importplugin
    __import__(mod)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/pdb.py", line 3, in <module>
    import pdb
  File "/Users/cory/.pyenv/versions/3.5.0/lib/python3.5/pdb.py", line 78, in <module>
    import signal
  File "/Users/cory/.pyenv/versions/3.5.0/lib/python3.5/signal.py", line 8, in <module>
    _IntEnum._convert(
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/enum/__init__.py", line 373, in __getattr__
    raise AttributeError(name)
AttributeError: _convert

Replacing crashed slave gw1
gw4 C / gw5 C / gw2 C / gw3 C[gw2] node down: Traceback (most recent call last):
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/enum/__init__.py", line 371, in __getattr__
    return cls._member_map_[name]
KeyError: '_convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/execnet/gateway_base.py", line 1072, in executetask
    do_exec(co, loc)  # noqa
  File "<string>", line 1, in do_exec
  File "<remote exec>", line 143, in <module>
  File "<remote exec>", line 120, in remote_initconfig
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 673, in fromdictargs
    pluginmanager = get_plugin_manager()
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 67, in get_plugin_manager
    pluginmanager.import_plugin(spec)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 332, in import_plugin
    self.register(mod, modname)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 189, in register
    reg(plugin, name)  # may call addhooks
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 612, in _register_plugin
    import pytest
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/pytest.py", line 17, in <module>
    _preloadplugins() # to populate pytest.* namespace so help(pytest) works
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 58, in _preloadplugins
    _preinit.append(get_plugin_manager())
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/config.py", line 67, in get_plugin_manager
    pluginmanager.import_plugin(spec)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 318, in import_plugin
    mod = importplugin(modname)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/core.py", line 367, in importplugin
    __import__(mod)
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/_pytest/pdb.py", line 3, in <module>
    import pdb
  File "/Users/cory/.pyenv/versions/3.5.0/lib/python3.5/pdb.py", line 78, in <module>
    import signal
  File "/Users/cory/.pyenv/versions/3.5.0/lib/python3.5/signal.py", line 8, in <module>
    _IntEnum._convert(
  File "/Users/cory/Documents/Python/hyper-h2/.tox/py35/lib/python3.5/site-packages/enum/__init__.py", line 373, in __getattr__
    raise AttributeError(name)
AttributeError: _convert

Here is the output from pip freeze:

py35)cory@corymbp:hyper-h2/ % pip freeze                  baefbec|master✓ [5m]
apipkg==1.4
coverage==3.7.1
enum34==1.0.4
execnet==1.4.1
h2==0.1.0
hpack==1.1.0
hyperframe==1.1.1
hypothesis==1.11.0
hypothesis-pytest==0.18.1
py==1.4.30
pytest==2.7.3
pytest-cov==2.1.0
pytest-xdist==1.13.1
wheel==0.24.0
@RonnyPfannschmidt
Copy link
Member

please uninstall the enum34 pacakge, which breaks any python that has enum and try again

@Lukasa
Copy link
Author

Lukasa commented Sep 15, 2015

@RonnyPfannschmidt Hmm. That does appear to be the problem. Thanks!

Out of curiosity, why doesn't it affect Python 3.4?

cory@corymbp:hyper-h2/ % . .tox/py34/bin/activate
(py34)cory@corymbp:hyper-h2/ % pip freeze
apipkg==1.4
coverage==3.7.1
enum34==1.0.4
execnet==1.4.1
h2==0.1.0
hpack==1.1.0
hyperframe==1.1.1
hypothesis==1.11.0
hypothesis-pytest==0.18.1
py==1.4.30
pytest==2.7.3
pytest-cov==2.1.0
pytest-xdist==1.13.1
wheel==0.24.0
(py34)cory@corymbp:hyper-h2/ % py.test -n 4 test/
============================= test session starts ==============================
platform darwin -- Python 3.4.3 -- py-1.4.30 -- pytest-2.7.3
rootdir: /Users/cory/Documents/Python/hyper-h2, inifile: 
plugins: hypothesis-pytest, cov, xdist, xdist, xdist
gw0 [97] / gw1 [97] / gw2 [97] / gw3 [97]
scheduling tests via LoadScheduling
.................................................................................................
========================== 97 passed in 2.86 seconds ===========================

@Lukasa Lukasa closed this as completed Sep 15, 2015
@RonnyPfannschmidt
Copy link
Member

most likely because its the same code

@Lukasa
Copy link
Author

Lukasa commented Sep 15, 2015

@RonnyPfannschmidt Seems like a compelling theory. Thanks again, sorry for taking up your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants