diff --git a/_pytest/monkeypatch.py b/_pytest/monkeypatch.py index c402213e8..c82ffd053 100644 --- a/_pytest/monkeypatch.py +++ b/_pytest/monkeypatch.py @@ -113,7 +113,7 @@ class MonkeyPatch(object): For convenience you can specify a string as ``target`` which will be interpreted as a dotted import path, with the last part being the attribute name. Example: - ``monkeypatch.setattr("os.getcwd", lambda x: "/")`` + ``monkeypatch.setattr("os.getcwd", lambda: "/")`` would set the ``getcwd`` function of the ``os`` module. The ``raising`` value determines if the setattr should fail