Make sure `monkeypatch.undo()` is always called
This commit is contained in:
parent
6e7dc8bac8
commit
303b6e32ea
|
@ -45,9 +45,8 @@ def monkeypatch() -> Generator["MonkeyPatch", None, None]:
|
||||||
fixture has finished. The ``raising`` parameter determines if a KeyError
|
fixture has finished. The ``raising`` parameter determines if a KeyError
|
||||||
or AttributeError will be raised if the set/deletion operation has no target.
|
or AttributeError will be raised if the set/deletion operation has no target.
|
||||||
"""
|
"""
|
||||||
mpatch = MonkeyPatch()
|
with MonkeyPatch.context() as mpatch:
|
||||||
yield mpatch
|
yield mpatch
|
||||||
mpatch.undo()
|
|
||||||
|
|
||||||
|
|
||||||
def resolve(name: str) -> object:
|
def resolve(name: str) -> object:
|
||||||
|
|
Loading…
Reference in New Issue