Restrict fix to macOS only. Ref #3215.

This commit is contained in:
Jason R. Coombs 2018-02-13 17:51:20 -05:00
parent 247cdb835a
commit 18c84a1904
1 changed files with 3 additions and 0 deletions

View File

@ -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)