Skip to content

Commit 4ff90b1

Browse files
authored
Merge pull request #6606 from blueyed/typing-monkeypatch-context
typing: MonkeyPatch.context
2 parents 2d29c3e + e25d46a commit 4ff90b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/_pytest/monkeypatch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import warnings
66
from contextlib import contextmanager
7+
from typing import Generator
78

89
import pytest
910
from _pytest.fixtures import fixture
@@ -108,7 +109,7 @@ def __init__(self):
108109
self._savesyspath = None
109110

110111
@contextmanager
111-
def context(self):
112+
def context(self) -> Generator["MonkeyPatch", None, None]:
112113
"""
113114
Context manager that returns a new :class:`MonkeyPatch` object which
114115
undoes any patching done inside the ``with`` block upon exit:

0 commit comments

Comments
 (0)