Skip to content

Commit 3c1159d

Browse files
committed
Ensure the correct stuff is written to stdout when recording and capturing
1 parent 051dd04 commit 3c1159d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_console.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def test_capture():
351351
assert capture.get() == "Hello\n"
352352

353353

354-
def test_capture_and_record():
354+
def test_capture_and_record(capsys):
355355
recorder = Console(record=True)
356356
recorder.print("ABC")
357357

@@ -360,9 +360,12 @@ def test_capture_and_record():
360360

361361
assert capture.get() == "Hello\n"
362362

363-
text = recorder.export_text()
364-
assert text == "ABC\nHello\n"
363+
recorded_text = recorder.export_text()
364+
out, err = capsys.readouterr()
365+
366+
assert recorded_text == "ABC\nHello\n"
365367
assert capture.get() == "Hello\n"
368+
assert out == "ABC\n"
366369

367370

368371
def test_input(monkeypatch, capsys):

0 commit comments

Comments
 (0)