My code is organized like this:
app/sampling
├── __init__.py
├── filters.py
└── test
└── filters_test.py
There filters.py
are some exported functions (included in __init__.py
) and some unexposed functions that begin with underscores.
As filters_test.py
I have no problem with testing of exported functions, I can access as follows:
from app.sampling import exported_function
(note that the "app" is part of my PYTHONPATH)
But if I try to import a private function, for example:
from ..filters import _private_function
This seems to work, but then at runtime:
SystemError: Parent module '' not loaded, cannot perform relative import
Additional notes:
- I use my nose to run tests.
- I would like to keep the folder structure if possible
source
share