You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Save failed pytest terminal screens for offline replay #136
A failed pytest terminal assertion can show two identical-looking boxes for a written space. A flight recorder can retain the full output byte stream while missing a resize that determined the final grid. A saved test artifact should let someone inspect the difference and replay that exact sequence on a different machine.
Motivation
A developer looking at CI output has the failure report and its artifacts. The original process may have exited. Existing issues cover the assertion text (#117) and capturing resize events (#127). The missing step is the pytest workflow that writes, identifies, and reopens the failing terminal state.
Evidence
Failure and offline replay from a test that narrowed its terminal before drawing
First difference at row 0, column 4: expected padding, actual ' '
row 0: ' X '
The example starts eight columns wide, shrinks to four, draws the marker, and expands again. Dropping the resize records from the file makes replay report a mismatch. A genuine PTY child can supply the recorded output bytes through the same fixture workflow.
Proposal
Give pytest users an opt-in artifact directory. On failure, preserve the initial geometry, incoming terminal bytes, ordered resizes, final rows and cursor, and the first known assertion difference. Print the file path in the test report. Provide a CLI that replays it offline and signals an incomplete or mismatched capture. Demonstrate a deliberately failing test, replay from another working directory, and a passing test that emits no artifact.
The local replay CLI detected removal of a resize and alteration of a cell style, including the case where visible text was identical. The failing pytest fixture saved the input, geometry changes and screen under --vt-replay-dir. Related PR #139
Activity
tony commentedon Dec 3, 2026
The local replay CLI detected removal of a resize and alteration of a cell style, including the case where visible text was identical. The failing pytest fixture saved the input, geometry changes and screen under
--vt-replay-dir. Related PR #139