Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/sync/test_vt_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ def test_git_tty_401_error_screen_snapshot(
"""
)

diagnostic = "terminal prompts disabled"
short_parent = pathlib.Path("/tmp")
with (
tempfile.TemporaryDirectory(
Expand Down Expand Up @@ -471,6 +472,8 @@ async def _exercise() -> tuple[Snapshot, int, bool]:
env=child_env,
tty_mode="cooked",
) as pty:
diagnostic_snapshot = await pty.wait_for(diagnostic, timeout=3.0)
assert diagnostic not in diagnostic_snapshot.text
snap = await pty.wait_for(lambda _s: pty.eof, timeout=3.0)
rc = await asyncio.wait_for(pty.process.wait(), timeout=1.0)
return snap, rc, pty.eof
Expand All @@ -481,13 +484,11 @@ async def _exercise() -> tuple[Snapshot, int, bool]:
(r"127\.0\.0\.1:\d+", "127.0.0.1:<PRT>"),
(clone_root, "<TMP>"),
]
unwrapped_text = "".join(
snap[idx].text + ("" if snap[idx].wrapped else "\n") for idx in range(snap.rows)
)
unwrapped_text = snap.unwrapped_text
assert reached_eof is True
assert returncode == 0, unwrapped_text
assert snap.cursor.visible is True
assert "terminal prompts disabled" in unwrapped_text
assert diagnostic in unwrapped_text
assert not any(
line.startswith("Username for ") for line in unwrapped_text.splitlines()
)
Expand Down
Loading