MCPcopy
hub / github.com/pytest-dev/pytest / activate_fixture

Method activate_fixture

src/_pytest/capture.py:819–823  ·  view source on GitHub ↗

If the current item is using ``capsys`` or ``capfd``, activate them so they take precedence over the global capture.

(self)

Source from the content-addressed store, hash-verified

817 self._capture_fixture = None
818
819 def activate_fixture(self) -> None:
820 """If the current item is using ``capsys`` or ``capfd``, activate
821 them so they take precedence over the global capture."""
822 if self._capture_fixture:
823 self._capture_fixture._start()
824
825 def deactivate_fixture(self) -> None:
826 """Deactivate the ``capsys`` or ``capfd`` fixture of this item, if any."""

Callers 1

item_captureMethod · 0.95

Calls 1

_startMethod · 0.80

Tested by

no test coverage detected