I have a mixed Python/C++ library with test files mixed in amongst source files in the same directories. The layout looks like
/home/irving/geode
geode
__init__.py
vector
__init__.py
test_vector.py
...
...
Unfortunately, the library is unusable in-place since it lacks .so extension modules. Question: Can I make py.test always use an installed version, even when run from /home/irving/geode
or a subdirectory?
The test files have from __future__ import absolute_import
, and run fine if executed directly as scripts. For example, if I do
cd geode/vector
./test_vector.py
which does import geode
, it finds the installed version. However, if I run py.test in geode/vector
, it finds the local copy of geode
, and then dies.