Skip to content

Commit 8b598f0

Browse files
committed
Make pytester use pytest's capture implementation
1 parent 6ba3475 commit 8b598f0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

_pytest/pytester.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from py.builtin import print_
1616

17+
from _pytest.capture import MultiCapture, SysCapture
1718
from _pytest._code import Source
1819
import py
1920
import pytest
@@ -737,7 +738,8 @@ def runpytest_inprocess(self, *args, **kwargs):
737738
if kwargs.get("syspathinsert"):
738739
self.syspathinsert()
739740
now = time.time()
740-
capture = py.io.StdCapture()
741+
capture = MultiCapture(Capture=SysCapture)
742+
capture.start_capturing()
741743
try:
742744
try:
743745
reprec = self.inline_run(*args, **kwargs)
@@ -752,7 +754,8 @@ class reprec(object):
752754
class reprec(object):
753755
ret = 3
754756
finally:
755-
out, err = capture.reset()
757+
out, err = capture.readouterr()
758+
capture.stop_capturing()
756759
sys.stdout.write(out)
757760
sys.stderr.write(err)
758761

0 commit comments

Comments
 (0)