Feedback about --import-mode=importlib in pytest 6.0
See original GitHub issueThis issue is a placeholder to gather feedback from users about the new --import-mode=importlib
introduced in pytest 6.0.
It is our intention to change the default to importlib
in future versions, and perhaps even eliminate the other --import-mode
options (prepend
and append
).
Issue Analytics
- State:
- Created 3 years ago
- Comments:56 (32 by maintainers)
Top Results From Across the Web
python 3.x - When should I use pytest --import-mode importlib
When pytest finds a test module, it goes to the parent folders until it finds the one that does not have __init__.py ....
Read more >1656918 - ichnaea tests broken with pytest 6.0 option --import-mode ...
This could mean that the mechanism is broken when importlib is used, or that more tests need to explicitly use the db fixture....
Read more >pytest import mechanisms and sys.path / PYTHONPATH
importlib : new in pytest-6.0, this mode uses importlib to import test modules. This gives full control over the import process, and doesn't...
Read more >Welcome to Pytest-BDD's documentation! - Read the Docs
pytest-bdd implements a subset of the Gherkin language to enable ... (olegpidsadnyi); Fix compatibility with pytest 6 --import-mode=importlib option.
Read more >10 Cool Pytest Tips You Might Not Know About - PyBites
Here are 10 things we learned writing pytest code that might come in ... import pytest def _can_import(): try: import comments # noqa...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We are planning to rewrite our pytest support thanks to guidance from the pytest team, so even if we were messing up it should be resolved in the future. 😄
Thanks everyone for the feedback.
Based on your feedback, it is clear that we should not change the
importmode
default toimportlib
, as it has its own set of drawbacks, not making it a clear winner, and changing the default would severely impact a lot of test suites.Closing this issue then, feel free to open new issues to discuss specific topics related to
--import-mode
. 👍