-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Upgrade pytest from 8.3.3 to 8.3.4 triggers AttributeError: module 'code' has no attribute '__path__'. Did you mean: '__all__'?
#13026
Comments
When the top-level directory is named
When the top-level directory is not named
I am currently trying to trace further details. UPDATE:
That is, If Sounds a bit risky—does anyone else have any thoughts? |
As mentioned in the fix #13026 , this issue only occurs for me when the option:
is used in my pyproject.toml settings. As a work-around, I removed it from my pyproject.toml, and now the tests also pass in pytest 8.3.4 |
Yes, there are a few temporary solutions:
|
Only parent modules with the `__path__` attribute can be used by the `find_spec` function, and most of the standard library does not meet this condition. Fixes #13026 .
…) (#13037) Only parent modules with the `__path__` attribute can be used by the `find_spec` function, and most of the standard library does not meet this condition. Fixes #13026 . (cherry picked from commit 8cff128) Co-authored-by: dongfangtianyu <[email protected]>
I have a number of pytest tests that used to work in 8.3.3.
Since I upgraded to pytest 8.3.4, these tests fail reliably in 2 different projects.
(see details below).
pip list
from the virtual environment you are usingMaybe related to this code below:
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
]
pythonpath = "code"
The text was updated successfully, but these errors were encountered: