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

Method global_and_fixture_disabled

src/_pytest/capture.py:841–855  ·  src/_pytest/capture.py::CaptureManager.global_and_fixture_disabled

Context manager to temporarily disable global and current fixture capturing.

(self)

Source from the content-addressed store, hash-verified

839
840 @contextlib.contextmanager
841 def global_and_fixture_disabled(self) -> Generator[None]:
842 class="st">""class="st">"Context manager to temporarily disable global and current fixture capturing."class="st">""
843 do_fixture = self._capture_fixture and self._capture_fixture._is_started()
844 if do_fixture:
845 self.suspend_fixture()
846 do_global = self._global_capturing and self._global_capturing.is_started()
847 if do_global:
848 self.suspend_global_capture()
849 try:
850 yield
851 finally:
852 if do_global:
853 self.resume_global_capture()
854 if do_fixture:
855 self.resume_fixture()
856
857 @contextlib.contextmanager
858 def item_capture(self, when: str, item: Item) -> Generator[None]:

Callers 2

emitMethod · 0.45
disabledMethod · 0.45

Calls 6

suspend_fixtureMethod · 0.95
resume_global_captureMethod · 0.95
resume_fixtureMethod · 0.95
_is_startedMethod · 0.80
is_startedMethod · 0.80

Tested by

no test coverage detected