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:
parent
56a5dbe252
commit
07b7b6fa7d
|
@ -152,6 +152,13 @@ class CaptureManager:
|
||||||
def _capturing_for_request(
|
def _capturing_for_request(
|
||||||
self, request: FixtureRequest
|
self, request: FixtureRequest
|
||||||
) -> Generator["CaptureFixture", None, None]:
|
) -> 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:
|
if self._capture_fixture:
|
||||||
other_name = next(
|
other_name = next(
|
||||||
k
|
k
|
||||||
|
|
Loading…
Reference in New Issue