From: Jacob Lifshay Date: Sat, 3 Jun 2023 03:11:27 +0000 (-0700) Subject: suspend default capture plugin while capturing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46d2bb04ef995f5ef2289fbdf1313f1804b2a427;p=pytest-output-to-files.git suspend default capture plugin while capturing --- diff --git a/pytest_output_to_files.py b/pytest_output_to_files.py index 91a8937..82e8484 100644 --- a/pytest_output_to_files.py +++ b/pytest_output_to_files.py @@ -242,12 +242,17 @@ class _OutputToFilesPlugin: @contextlib.contextmanager def __capture_item(self, item, when): # type: (pytest.Item, str) -> Generator[Any, Any, Any] + builtin_capman = item.config.pluginmanager.getplugin("capturemanager") + if builtin_capman is not None: + builtin_capman.suspend_global_capture() try: self.__start(item, when) yield self.__stop(item, when) finally: self.__abort() + if builtin_capman is not None: + builtin_capman.resume_global_capture() @pytest.hookimpl(tryfirst=True) def pytest_keyboard_interrupt(self, excinfo):