From 18c84a1904e96d5a4fc265b0fde56765ca36c7c3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 13 Feb 2018 17:51:20 -0500 Subject: [PATCH] Restrict fix to macOS only. Ref #3215. --- _pytest/doctest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_pytest/doctest.py b/_pytest/doctest.py index 112a700ec..6a2918b6f 100644 --- a/_pytest/doctest.py +++ b/_pytest/doctest.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, division, print_function import traceback import sys +import platform import pytest from _pytest._code.code import ExceptionInfo, ReprFileLocation, TerminalRepr @@ -111,6 +112,8 @@ class DoctestItem(pytest.Item): """ Disable output capturing. Otherwise, stdout is lost to doctest (#985) """ + if platform.system() != 'Darwin': + return capman = self.config.pluginmanager.getplugin("capturemanager") if capman: out, err = capman.suspend_global_capture(in_=True)