diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 91d590fb3..08f958b9b 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -42,7 +42,8 @@ def monkeypatch() -> Generator["MonkeyPatch", None, None]: monkeypatch.chdir(path) All modifications will be undone after the requesting test function or - fixture has finished. The ``raising`` parameter determines if a KeyError + fixture has finished. It is possible to undo them earlier by calling + ``monkeypatch.undo()``. The ``raising`` parameter determines if a KeyError or AttributeError will be raised if the set/deletion operation has no target. """ mpatch = MonkeyPatch()