Skip to content

Pytest can't find locally installed projects #613

Closed
@pytestbot

Description

@pytestbot

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)


Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions