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
This commit is contained in:
parent
38a3e30cd9
commit
f0f19aa8d9
|
@ -16,6 +16,7 @@ functionality in tests:
|
|||
.. code-block:: python
|
||||
|
||||
monkeypatch.setattr(obj, name, value, raising=True)
|
||||
monkeypatch.setattr("somemodule.obj.name", value, raising=True)
|
||||
monkeypatch.delattr(obj, name, raising=True)
|
||||
monkeypatch.setitem(mapping, name, value)
|
||||
monkeypatch.delitem(obj, name, raising=True)
|
||||
|
|
Loading…
Reference in New Issue