Make pytester use pytest's capture implementation
This commit is contained in:
parent
6ba3475448
commit
8b598f00e9
|
@ -14,6 +14,7 @@ from weakref import WeakKeyDictionary
|
|||
|
||||
from py.builtin import print_
|
||||
|
||||
from _pytest.capture import MultiCapture, SysCapture
|
||||
from _pytest._code import Source
|
||||
import py
|
||||
import pytest
|
||||
|
@ -737,7 +738,8 @@ class Testdir(object):
|
|||
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)
|
||||
|
@ -752,7 +754,8 @@ class Testdir(object):
|
|||
class reprec(object):
|
||||
ret = 3
|
||||
finally:
|
||||
out, err = capture.reset()
|
||||
out, err = capture.readouterr()
|
||||
capture.stop_capturing()
|
||||
sys.stdout.write(out)
|
||||
sys.stderr.write(err)
|
||||
|
||||
|
|
Loading…
Reference in New Issue