[issue46241] importlib.utils.find_spec() has issues with "tests" folder

2022-01-05 Thread Daniël van Noord
Daniël van Noord added the comment: Thanks Brett for that explanation! Makes sense actually now that I think about it. I also wondered how astroid got onto my sys.path, but that's something for another time :) -- ___ Python tracker

[issue46241] importlib.utils.find_spec() has issues with "tests" folder

2022-01-05 Thread Brett Cannon
Brett Cannon added the comment: This is working as intended. Because you don't have a `__init__.py` file in your `tests` directory, Python considers it a potential namespace package. As such, Python keeps searching for a "normal" package that defines `__init__.py` for the same package name.

[issue46241] importlib.utils.find_spec() has issues with "tests" folder

2022-01-03 Thread Daniël van Noord
Change by Daniël van Noord : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46241] importlib.utils.find_spec() has issues with "tests" folder

2022-01-03 Thread Daniël van Noord
New submission from Daniël van Noord : Affected folder structure: ── module_loader │ ├── __init__.py ├── pyproject.toml ├── setup.cfg └── tests └── test_module_loader.py ```console ❯ cat '/Users/daniel/DocumentenLaptop/Programming/Test/module_loader/module_loader/__init__.py' from