From e71d907d3471e5cc10ab7de9a07f1706a30aca29 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Mon, 12 Mar 2018 15:19:26 +0100 Subject: [PATCH] Typo in example, os.getcwd does not take any parameter. --- _pytest/monkeypatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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