MCPcopy Create free account
hub / github.com/pytest-dev/pytest / set_fixture

Method set_fixture

src/_pytest/capture.py:695–704  ·  view source on GitHub ↗
(self, capture_fixture: "CaptureFixture[Any]")

Source from the content-addressed store, hash-verified

693 # Fixture Control
694
695 def set_fixture(self, capture_fixture: "CaptureFixture[Any]") -> None:
696 if self._capture_fixture:
697 current_fixture = self._capture_fixture.request.fixturename
698 requested_fixture = capture_fixture.request.fixturename
699 capture_fixture.request.raiseerror(
700 "cannot use {} and {} at the same time".format(
701 requested_fixture, current_fixture
702 )
703 )
704 self._capture_fixture = capture_fixture
705
706 def unset_fixture(self) -> None:
707 self._capture_fixture = None

Callers 4

capsysFunction · 0.80
capsysbinaryFunction · 0.80
capfdFunction · 0.80
capfdbinaryFunction · 0.80

Calls 2

raiseerrorMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected