[TIP] import path and nosetests

andrea crotti andrea.crotti.0 at gmail.com
Mon Feb 11 04:20:32 PST 2013


I'm having a stupid problem with imports and nosetests.
Basically in a file this fails

from tests.unit.app.handlers.test_es_filters import USER_ALL

with:
ImportError: No module named unit.app.handlers.test_es_filters

I run the tests with this:

#!/bin/bash
export PYTHONPATH=".:$PYTHONPATH"
ve/bin/nosetests -sv tests

but running manually:
python -c 'from tests.unit.app.handlers.test_es_filters import USER_ALL'

from the same directory where I launch the test from works perfectly
though, and the path is certainly correct.
Any hint?



More information about the testing-in-python mailing list