Add back prompt expect via flag

sigintsaviour_citesthackin
Tyler Goodlet 2022-07-12 12:15:17 -04:00
parent 9bed332a94
commit 6ccfeb17d5
1 changed files with 7 additions and 5 deletions

View File

@ -150,6 +150,7 @@ def do_ctlc(
child, child,
count: int = 3, count: int = 3,
delay: float = 0.1, delay: float = 0.1,
expect_prompt: bool = True,
patt: Optional[str] = None, patt: Optional[str] = None,
) -> None: ) -> None:
@ -161,13 +162,14 @@ def do_ctlc(
# TODO: figure out why this makes CI fail.. # TODO: figure out why this makes CI fail..
# if you run this test manually it works just fine.. # if you run this test manually it works just fine..
# time.sleep(delay) if expect_prompt:
# child.expect(r"\(Pdb\+\+\)") time.sleep(delay)
# time.sleep(delay) child.expect(r"\(Pdb\+\+\)")
time.sleep(delay)
before = str(child.before.decode())
if patt: if patt:
# should see the last line on console # should see the last line on console
before = str(child.before.decode())
assert patt in before assert patt in before
@ -238,8 +240,8 @@ def test_subactor_error(
# creating actor # creating actor
child.sendline('continue') child.sendline('continue')
child.expect(r"\(Pdb\+\+\)") child.expect(r"\(Pdb\+\+\)")
before = str(child.before.decode()) before = str(child.before.decode())
# root actor gets debugger engaged # root actor gets debugger engaged
assert "Attaching to pdb in crashed actor: ('root'" in before assert "Attaching to pdb in crashed actor: ('root'" in before
# error is a remote error propagated from the subactor # error is a remote error propagated from the subactor