Skip to content

import from test broken by pip install #8270

Answered by TomGoBravo
TomGoBravo asked this question in Q&A
Discussion options

You must be logged in to vote

@hoefling provided a rather complete explanation in comments to this question at https://stackoverflow.com/questions/65910240/pytest-breaks-with-pip-install

"Short answer - don't create packages or modules that are name-shadowing the standard library, this will always break something sooner or later"

"As a workaround, I can suggest creating a conftest.py in the project root dir with the contents import sys; sys.modules.pop("test", None) - this should resolve the import issue."

Thank you Oleg!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TomGoBravo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant