4 ms·
I have seen way too many `ModuleNotFoundError`s. It is moderately infuriating when the two files are in the same directory and python can't find the module. Ho
by josephorjoe 5y ago
I have seen way too many `ModuleNotFoundError`s. It is moderately infuriating when the two files are in the same directory and python can't find the module.
Honestly that error is misnamed. It should be `ModuleImportRefusedError`.
And the frustration caused by getting PyTest to work in a project is likely responsible for a large percentage of the untested python projects in the world...
- mixmastamyk 5y agoI’ve not had either of these issues. Maybe a detail left out?
- josephorjoe 5y agothe first occurs if you haven't created __init__.py. the second occurs if you want your test files outside of the package directory (e.g., project/src/foo_app/foo.py, project/test/test_foo.py)