Skip to content

Commit

Permalink
Do not advertise that importlib will be default import mode
Browse files Browse the repository at this point in the history
It is clear at this point that changing the default would break a lot of suites, and is not a clear win in all cases anyway.

Close pytest-dev#10003
  • Loading branch information
nicoddemus committed May 31, 2022
1 parent a72e8b3 commit 3fa4325
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doc/en/explanation/pythonpath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@ these values:

* ``importlib``: new in pytest-6.0, this mode uses :mod:`importlib` to import test modules. This gives full control over the import process, and doesn't require changing :py:data:`sys.path`.

For this reason this doesn't require test module names to be unique, but also makes test
modules non-importable by each other.
For this reason this doesn't require test module names to be unique.

One drawback however is that test modules are non-importable by each other. Also, utility
modules in the tests directories are not automatically importable because the tests directory is no longer
added to :py:data:`sys.path`.

Initially we intended to make ``importlib`` the default in future releases, however it is clear now that
it has its own set of drawbacks so the default will remain ``prepend`` for the foreseeable future.

.. seealso::

The :confval:`pythonpath` configuration variable.

We intend to make ``importlib`` the default in future releases, depending on feedback.

``prepend`` and ``append`` import modes scenarios
-------------------------------------------------
Expand Down

0 comments on commit 3fa4325

Please sign in to comment.