Skip to content

Commit

Permalink
Ensure the correct stuff is written to stdout when recording and capt…
Browse files Browse the repository at this point in the history
…uring
  • Loading branch information
darrenburns committed Jun 16, 2022
1 parent 051dd04 commit 3c1159d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def test_capture():
assert capture.get() == "Hello\n"


def test_capture_and_record():
def test_capture_and_record(capsys):
recorder = Console(record=True)
recorder.print("ABC")

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

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

text = recorder.export_text()
assert text == "ABC\nHello\n"
recorded_text = recorder.export_text()
out, err = capsys.readouterr()

assert recorded_text == "ABC\nHello\n"
assert capture.get() == "Hello\n"
assert out == "ABC\n"


def test_input(monkeypatch, capsys):
Expand Down

0 comments on commit 3c1159d

Please sign in to comment.