question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feedback about --import-mode=importlib in pytest 6.0

See original GitHub issue

This 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:closed
  • Created 3 years ago
  • Comments:56 (32 by maintainers)

github_iconTop GitHub Comments

4reactions
brettcannoncommented, May 17, 2021

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. 😄

2reactions
nicoddemuscommented, May 31, 2022

Thanks everyone for the feedback.

Based on your feedback, it is clear that we should not change the importmode default to importlib, 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. 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found