Skip to content

Commit 0dac278

Browse files
committed
Merge toolbar EOF regression coverage from persistent-bottom-bar
2 parents a715034 + 6cb419d commit 0dac278

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎tests/test_command_toolbar.py‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,28 @@ def test_command_toolbar_failure_after_startup_is_reported(toolbar_app, capsys)
468468
assert "after failure\n" in output.getvalue()
469469

470470

471+
def test_command_toolbar_input_eof_is_not_reported(toolbar_app, capsys) -> None:
472+
app, pipe, output = toolbar_app
473+
474+
with app._command_toolbar_context():
475+
toolbar = app._command_toolbar
476+
# Losing the terminal's input ends the display with EOFError. That is an
477+
# ordinary shutdown, not a failure the running command should hear about.
478+
pipe.close()
479+
toolbar._thread.join(timeout=2)
480+
assert not toolbar._thread.is_alive()
481+
assert toolbar._error is None
482+
483+
# Output must still reach the terminal rather than a proxy nothing is draining.
484+
assert all(stream.proxy is None for stream in toolbar._streams)
485+
app.poutput("after eof")
486+
487+
assert capsys.readouterr().err == ""
488+
assert "after eof\n" in output.getvalue()
489+
assert app.stdout is output
490+
assert app._command_toolbar is None
491+
492+
471493
def test_command_toolbar_render_failure(toolbar_app) -> None:
472494
app, _, output = toolbar_app
473495

0 commit comments

Comments
 (0)