From 3d97531797d2fed797b7715787648049a669c422 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 9 Feb 2020 08:40:43 +0100 Subject: [PATCH] doc: add docstring for CaptureManager._capturing_for_request Based on the removed doc for `_install_capture_fixture_on_item`. Follow-up to https://github.com/pytest-dev/pytest/pull/6663. Update src/_pytest/capture.py [ci skip] Co-Authored-By: Ran Benita --- src/_pytest/capture.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index bd17d05ef59..d3f10da2f14 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -152,6 +152,13 @@ def read_global_capture(self): def _capturing_for_request( self, request: FixtureRequest ) -> Generator["CaptureFixture", None, None]: + """ + Context manager that creates a ``CaptureFixture`` instance for the + given ``request``, ensuring there is only a single one being requested + at the same time. + + This is used as a helper with ``capsys``, ``capfd`` etc. + """ if self._capture_fixture: other_name = next( k