My code is organized this way:
app/sampling
├── __init__.py
├── filters.py
└── test
└── filters_test.py
On filters.py
there are some exported functions (included in __init__.py
) and some unexported functions, that begin with underscore.
On filters_test.py
I have no trouble testing the exported functions, that I can access like this:
from app.sampling import exported_function
(note that "app" is part of my PYTHONPATH)
But then if I try to import a private function like this:
from ..filters import _private_function
This seems to work but then on runtime:
SystemError: Parent module '' not loaded, cannot perform relative import
Additional notes:
from app.sampling.filters import _private_function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With