Skip to content

Commit 07b7b6f

Browse files
blueyedbluetech
andauthored
doc: add docstring for CaptureManager._capturing_for_request (pytest-dev#6698)
Based on the removed doc for `_install_capture_fixture_on_item`. Follow-up to pytest-dev#6663. Co-authored-by: Ran Benita <[email protected]>
1 parent 56a5dbe commit 07b7b6f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/_pytest/capture.py

+7
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ def read_global_capture(self):
152152
def _capturing_for_request(
153153
self, request: FixtureRequest
154154
) -> Generator["CaptureFixture", None, None]:
155+
"""
156+
Context manager that creates a ``CaptureFixture`` instance for the
157+
given ``request``, ensuring there is only a single one being requested
158+
at the same time.
159+
160+
This is used as a helper with ``capsys``, ``capfd`` etc.
161+
"""
155162
if self._capture_fixture:
156163
other_name = next(
157164
k

0 commit comments

Comments
 (0)