From ab5af524a454585bc6ce02374964f198cbcf8670 Mon Sep 17 00:00:00 2001 From: Jiri Kuncar Date: Mon, 27 Aug 2018 15:34:56 +0200 Subject: [PATCH] Fix macOS specific code that uses capturemanager. https://github.com/pytest-dev/pytest/issues/3888#issuecomment-416206606 closes #3888 Co-authored-by: Bruno Oliveira --- changelog/3888.bugfix.rst | 1 + src/_pytest/doctest.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/3888.bugfix.rst diff --git a/changelog/3888.bugfix.rst b/changelog/3888.bugfix.rst new file mode 100644 index 00000000000..17e00a82848 --- /dev/null +++ b/changelog/3888.bugfix.rst @@ -0,0 +1 @@ +Fix macOS specific code using ``capturemanager`` plugin in doctests. diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 57d3367e403..12b871f9fa3 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -203,7 +203,8 @@ def _disable_output_capturing_for_darwin(self): return capman = self.config.pluginmanager.getplugin("capturemanager") if capman: - out, err = capman.suspend_global_capture(in_=True) + capman.suspend_global_capture(in_=True) + out, err = capman.read_global_capture() sys.stdout.write(out) sys.stderr.write(err)