Skip to content

Commit bd34bd8

Browse files
authored
fix docs about syspath_prepend (#5656)
fix docs about syspath_prepend
2 parents 7fa2748 + ebfe8ea commit bd34bd8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/en/monkeypatch.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@ environment variable is missing, or to set multiple values to a known variable.
4646
:py:meth:`monkeypatch.setenv` and :py:meth:`monkeypatch.delenv` can be used for
4747
these patches.
4848

49-
4. Use :py:meth:`monkeypatch.syspath_prepend` to modify the system ``$PATH`` safely, and
49+
4. Use ``monkeypatch.setenv("PATH", value, prepend=True)`` to modify ``$PATH``, and
5050
:py:meth:`monkeypatch.chdir` to change the context of the current working directory
5151
during a test.
5252

53+
5. Use py:meth:`monkeypatch.syspath_prepend` to modify ``sys.path`` which will also
54+
call :py:meth:`pkg_resources.fixup_namespace_packages` and :py:meth:`importlib.invalidate_caches`.
55+
5356
See the `monkeypatch blog post`_ for some introduction material
5457
and a discussion of its motivation.
5558

0 commit comments

Comments
 (0)