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 <ran234@gmail.com>
This commit is contained in:
Daniel Hahler
2020-02-13 12:09:32 +01:00
committed by GitHub
parent 56a5dbe252
commit 07b7b6fa7d

View File

@@ -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