Skip to content

Pytest can't find locally installed projects #613

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

Closed
pytestbot opened this issue Oct 8, 2014 · 3 comments
Closed

Pytest can't find locally installed projects #613

pytestbot opened this issue Oct 8, 2014 · 3 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Tobias Wellnitz (BitBucket: dh1tw, GitHub: dh1tw)


Hi,

when running py.test (OSX 10.9 with virtualenv), py.test can't find third party projects which are installed from a local source (e.g.: pip install -e pyhamtools). However in the python console I can import modules from the project without any problems (within the same virtualenv).

project/test/test_mytest.py:

#!python

import pytest
import pyhamtools  #pytest doesn't find this project
from myproject import myfunction

class TestDecodeMyData:
    def test_decoding_data_correctly(self):
        assert (myfunction("me")) == pyhamtools.get_user("me")

Executing pytest returns:

#!bash

================================================================ test session starts ================================================================
platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2
collected 0 items / 1 errors 

============================= test session starts =============================
platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2
collected 0 items / 1 errors 

=================================== ERRORS ====================================
____________ ERROR collecting test/test_decoding_skimmer_spots.py _____________
test/test_decoding_data_correctly.py:2: in <module>
>   import pyhamtools
E   ImportError: No module named pyhamtools
=========================== 1 error in 0.06 seconds ===========================

Dump of "pip list":

#!bash

beautifulsoup4 (4.3.2)
myproject (0.1)
pip (1.4.1)
py (1.4.25)
pyephem (3.7.5.3)
pyhamtools (0.5.0, /Users/tobias/projects/pyhamtools)
pytest (2.6.3)
pytz (2014.7)
requests (2.4.1)
setuptools (0.9.8)
wsgiref (0.1.2)


@pytestbot
Copy link
Contributor Author

Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


something is for sure wrong with your virtualenv, consider recreating it from scratch: pip reports pytest 2.6.3 is installed
but console output of the pytest reports 2.5.2

@pytestbot
Copy link
Contributor Author

Original comment by Tobias Wellnitz (BitBucket: dh1tw, GitHub: dh1tw):


Thanks Anatoly. Indeed - rebuilding the virtualenv just solved the problem.

Problem resolved!

@pytestbot
Copy link
Contributor Author

Original comment by Tobias Wellnitz (BitBucket: dh1tw, GitHub: dh1tw):


The Virtualenv was corrupt. Rebuilding the virtualenv solved the problem.

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant