-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError
fired from importlib
during collection when running with --import-mode=importlib
on a directory containing a same-named one
#12592
Labels
topic: collection
related to the collection phase
Comments
Feels like this might be an upstream issue; we should try to get a reproducer using stdlib code only. |
dongfangtianyu
added a commit
to dongfangtianyu/pytest
that referenced
this issue
Aug 30, 2024
…in the namespace package causes a KeyError.(pytest-dev#12592)
dongfangtianyu
added a commit
to dongfangtianyu/pytest
that referenced
this issue
Aug 30, 2024
…in the namespace package causes a KeyError.(pytest-dev#12592)
dongfangtianyu
added a commit
to dongfangtianyu/pytest
that referenced
this issue
Aug 31, 2024
…in the namespace package causes a KeyError.(pytest-dev#12592)
dongfangtianyu
added a commit
to dongfangtianyu/pytest
that referenced
this issue
Sep 3, 2024
…in the namespace package causes a KeyError.(pytest-dev#12592)
nicoddemus
pushed a commit
that referenced
this issue
Sep 26, 2024
#12843) Directories inside a namespace package with the same name as the namespace package would cause a `KeyError` with `--import-mode=importlib`. Fixes #12592 Co-authored-by: Bruno Oliveira <bruno@pytest.org> (cherry picked from commit 6486c3f) Co-authored-by: dongfangtianyu <7629022+dongfangtianyu@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A detailed description of the bug or problem you are having
When creating the following structure:
then
pytest --import-mode=importlib
fails with the following cryptic message:To trigger this bug:
Running with
--pdb
gives a slightly more useful backtrace:Output of
pip list
from the virtual environment you are usingI tried this on a minimal poetry env with just
pytest
pytest and operating system versions
pytest 8.2.2. Encountered this both with python 3.10 and python 3.12, so the python version doesn't seem to be a factor.
Running on Ubuntu 22.04.4 LTS.
cc @criemen who encountered this
The text was updated successfully, but these errors were encountered: