Skip to content

Commit f0f19aa

Browse files
authored
doc: Point out two-argument form of monkeypatch.setattr
See the "for convenience" part here: https://docs.pytest.org/en/stable/reference.html#pytest.MonkeyPatch.setattr
1 parent 38a3e30 commit f0f19aa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/en/monkeypatch.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ functionality in tests:
1616
.. code-block:: python
1717
1818
monkeypatch.setattr(obj, name, value, raising=True)
19+
monkeypatch.setattr("somemodule.obj.name", value, raising=True)
1920
monkeypatch.delattr(obj, name, raising=True)
2021
monkeypatch.setitem(mapping, name, value)
2122
monkeypatch.delitem(obj, name, raising=True)

0 commit comments

Comments
 (0)