Open vishnu-chopra opened 1 year ago
Thanks for submitting this! I haven't used relative imports much myself, so it may very well be a bug in pydoctest.
I don't know if types.py
is perhaps clashing with the builtin types
module, since if I rename it to e.g. types_test.py
, I instead get ImportError('attempted relative import with no known parent package')
, similar to running python3 types_test.py
. I'll see if I can find the problem.
I never got around to look further into this. Can someone create a minimal reproduce of the issue?
I have a folder with 2 files
types.py
andcommon.py
.types.py
Imports fromcommon.py
I get the following error:
Failed to load module dependant module: No module named 'types.common'; 'types' is not a package
For the time being I have put a workaround to maintain the package behaviour and satisfy pydoctest, however this seems like a bug IMO, please let me know if I am mistaken.