Skip to content

Latest commit

 

History

History
8 lines (7 loc) · 593 Bytes

8006.feature.rst

File metadata and controls

8 lines (7 loc) · 593 Bytes

It is now possible to construct a ~pytest.MonkeyPatch object directly as pytest.MonkeyPatch(), in cases when the monkeypatch fixture cannot be used. Previously some users imported it from the private _pytest.monkeypatch.MonkeyPatch namespace.

Additionally, MonkeyPatch.context <pytest.MonkeyPatch.context> is now a classmethod, and can be used as with MonkeyPatch.context() as mp: .... This is the recommended way to use MonkeyPatch directly, since unlike the monkeypatch fixture, an instance created directly is not undo()-ed automatically.