-
Notifications
You must be signed in to change notification settings - Fork 106
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
Use importlib to avoid module name clashes for pytest #203
Conversation
regarding loading test modules with identical names
This is very useful! Any chances to get this merged? |
Moscow Python Beer Meetup report rules! |
This would be very helpful |
This is an amazing feature! |
@RonnyPfannschmidt |
this is a nice solution we can use as a temporary opt in, but im under the impression we are missing a deeper detail however i don't have time in the near future to work deeply enough into the related topic to make a good case for those details as such i believe a good way forward is to get this in, have it as opt-in in pytest an sort out the more detailed issues after the port to pathlib is complete |
We just need a CHANGELOG entry so we can merge this in. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the CHANGELOG
🎉 |
Thanks again @neumond for the great PR! |
@neumond |
btw: would it still possible to support relative imports? ( |
Created pytest-dev/pytest#5352. |
This allows simple modification for pytest
--import-mode=importlib
to completely avoid module naming issue if you have fresh python (>=3.5). This skips modifying sys.path, guessing package names, attempting to correctly import__init__.py
and directories. This is more than enough for usual pytest workflow, e.g. if you have unimportabletests
directory with files liketest_something.py
.