python - NoseGAE not able to import .py files in application root -
i'm trying automatic pydev/nosetests/gae setup going in eclipse, verifying command-line tinkering. far, have looks following:
preferences -> pydev -> pyunit
nose test runner parameters: --with-gae -w "/my/app/root" --without-sandbox -p
directory structure (normal gae stuff omitted)
./src/ *module hierarchy* ./tests/ __init__.py sometests.py ./main.py ./urls.py
at moment, when use same parameters on command-line in app root, python modules within src/ import 'main' or 'urls' cause:
error: failure: importerror (no module named main)
note: similar problem another post related nose. solution isn't applicable in case, there no __init__.py
in application root.
for work, you'd need have structure 2 pythonpath entries, 1 adding 'src' , other adding project root...
i.e.: have:
/project <- add pythonpath (i.e. set source folder in pydev)
/project/src <- add pythonpath (also set source folder in pydev)
/project/main.py <- should found parent folder in pythonpath :)
still, must find structure bit awkward... in use case, i'd drop 'src' folder , leave '/project' in pythonpath (and move contents of 'src' project root)
or move 'main.py', 'urls.py' , 'tests' 'src' folder...
Comments
Post a Comment