typing: MonkeyPatch.context
This commit is contained in:
parent
18ac7e0b79
commit
e25d46aae6
|
@ -4,6 +4,7 @@ import re
|
|||
import sys
|
||||
import warnings
|
||||
from contextlib import contextmanager
|
||||
from typing import Generator
|
||||
|
||||
import pytest
|
||||
from _pytest.fixtures import fixture
|
||||
|
@ -108,7 +109,7 @@ class MonkeyPatch:
|
|||
self._savesyspath = None
|
||||
|
||||
@contextmanager
|
||||
def context(self):
|
||||
def context(self) -> Generator["MonkeyPatch", None, None]:
|
||||
"""
|
||||
Context manager that returns a new :class:`MonkeyPatch` object which
|
||||
undoes any patching done inside the ``with`` block upon exit:
|
||||
|
|
Loading…
Reference in New Issue