Fix macOS specific code that uses capturemanager.

https://github.com/pytest-dev/pytest/issues/3888#issuecomment-416206606

closes #3888

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
Jiri Kuncar 2018-08-27 15:34:56 +02:00
parent 9620b167d9
commit ab5af524a4
No known key found for this signature in database
GPG Key ID: E734A642BEA9BF0B
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1 @@
Fix macOS specific code using ``capturemanager`` plugin in doctests.

View File

@ -203,7 +203,8 @@ class DoctestItem(pytest.Item):
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)