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

xdist chooses the wrong package version #64

Open
nonatomiclabs opened this issue Jun 6, 2016 · 2 comments
Open

xdist chooses the wrong package version #64

nonatomiclabs opened this issue Jun 6, 2016 · 2 comments
Labels

Comments

@nonatomiclabs
Copy link

When installing two different versions of a package in the same environment, xdist doesn't pick the same version as regular pytest.


Steps to reproduce using Invoke package for instance:

virtualenv ENV && source ENV/bin/activate
pip install pytest pytest-xdist invoke==0.11.0

Download the source of Invoke 0.12.2 and install it with python setup.py install.

I have a dummy test file test_version.py, containing:

import invoke

def test_version():
    assert False, str(invoke.__version__)

When running py.test test_version.py, we see that the test is running with Invoke 0.12.2:

============================ test session starts =============================
platform darwin -- Python 2.7.10, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /Users/jcruy/Desktop/xdist_bug, inifile: 
plugins: xdist-1.14
collected 1 items 

test_version.py F

================================== FAILURES ==================================
________________________________ test_version ________________________________

    def test_version():
>       assert False, str(invoke.__version__)
E       AssertionError: 0.12.2
E       assert False

test_version.py:5: AssertionError
========================== 1 failed in 0.09 seconds ==========================

However, when running it with xdist (py.test test_version.py -n 2), we see that the test is running with Invoke 0.11.0:

============================ test session starts =============================
platform darwin -- Python 2.7.10, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /Users/jcruy/Desktop/xdist_bug, inifile: 
plugins: xdist-1.14
gw0 [1] / gw1 [1]
scheduling tests via LoadScheduling
F
================================== FAILURES ==================================
________________________________ test_version ________________________________
[gw1] darwin -- Python 2.7.10 /Users/jcruy/Desktop/xdist_bug/ENV/bin/python
def test_version():
>       assert False, str(invoke.__version__)
E       AssertionError: 0.11.0
E       assert False

test_version.py:5: AssertionError
========================== 1 failed in 0.45 seconds ==========================

Notes:

  • I chose the Invoke package for example's sake only, it happens with other packages as well.
  • I know that it's not a really good thing to install two versions of a packages in the same environment, but I believe that the behaviour between pytest and xdist should at least be consistent.
  • I would gladly contribute to a fix, if you point me to the area of the code which might be responsible for that.

Environment:

  • OS X 10.11.4
  • Python 2.7.10
  • pytest 2.9.2
  • pytest-xdist 1.14
@nicoddemus nicoddemus added the bug label Jun 6, 2016
@nicoddemus
Copy link
Member

Thanks for the report!

@RonnyPfannschmidt
Copy link
Member

This issue might be rooted in execnet

We should decide if we want to support egg installs all all

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

No branches or pull requests

3 participants