Skip to content

Commit

Permalink
Replace py.io.StdCaptureFD with _pytest.capture.MultiCapture. Refs de…
Browse files Browse the repository at this point in the history
  • Loading branch information
fschulze committed Oct 9, 2023
1 parent cffa35c commit 9ee63b8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions client/testing/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import print_function
from _pytest import capture
from contextlib import closing
from devpi_common.metadata import parse_version
from io import StringIO
Expand Down Expand Up @@ -522,8 +523,11 @@ def doit(*args, **kwargs):
def out_devpi(devpi):
def out_devpi_func(*args, **kwargs):
from _pytest.pytester import RunResult
cap = py.io.StdCaptureFD()
cap.startall()
cap = capture.MultiCapture(
in_=capture.FDCapture(0),
out=capture.FDCapture(1),
err=capture.FDCapture(2))
cap.start_capturing()
now = time.time()
ret = 0
try:
Expand All @@ -532,7 +536,8 @@ def out_devpi_func(*args, **kwargs):
if getattr(hub, "sysex", None):
ret = hub.sysex.args[0]
finally:
out, err = cap.reset()
(out, err) = cap.readouterr()
cap.stop_capturing()
del cap
except BaseException:
print(out)
Expand Down

0 comments on commit 9ee63b8

Please sign in to comment.