From 07b7b6fa7d833124bb6d16d67c75a64d82ce0ec4 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 13 Feb 2020 12:09:32 +0100 Subject: [PATCH] doc: add docstring for CaptureManager._capturing_for_request (#6698) Based on the removed doc for `_install_capture_fixture_on_item`. Follow-up to https://github.com/pytest-dev/pytest/pull/6663. 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 bd17d05ef..d3f10da2f 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -152,6 +152,13 @@ class CaptureManager: 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