Skip to content

Commit

Permalink
Make pytester use pytest's capture implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Feb 19, 2017
1 parent f6d5651 commit 8091184
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from py.builtin import print_

from _pytest.capture import MultiCapture, SysCapture
from _pytest._code import Source
import py
import pytest
Expand Down Expand Up @@ -734,7 +735,8 @@ def runpytest_inprocess(self, *args, **kwargs):
if kwargs.get("syspathinsert"):
self.syspathinsert()
now = time.time()
capture = py.io.StdCapture()
capture = MultiCapture(Capture=SysCapture)
capture.start_capturing()
try:
try:
reprec = self.inline_run(*args, **kwargs)
Expand All @@ -749,7 +751,8 @@ class reprec:
class reprec:
ret = 3
finally:
out, err = capture.reset()
out, err = capture.readouterr()
capture.stop_capturing()
sys.stdout.write(out)
sys.stderr.write(err)

Expand Down

0 comments on commit 8091184

Please sign in to comment.