From: Christian Heller Date: Mon, 15 Sep 2025 21:49:43 +0000 (+0200) Subject: Don't kill testing keyboard and server input simulation loops after timeout. X-Git-Url: https://plomlompom.com/repos/process_efforts?a=commitdiff_plain;h=375a149bc27ce8f1214b74428ddae23a1c723aff;p=ircplom Don't kill testing keyboard and server input simulation loops after timeout. --- diff --git a/ircplom/testing.py b/ircplom/testing.py index f57c59f..f72f731 100644 --- a/ircplom/testing.py +++ b/ircplom/testing.py @@ -46,7 +46,7 @@ class TestTerminal(QueueMixin, TerminalInterface): try: to_yield = self._q_keypresses.get(timeout=0.1) except QueueEmpty: - break + yield None yield TuiEvent.affector('handle_keyboard_event' ).kw(typed_in=to_yield) @@ -75,7 +75,7 @@ class _FakeIrcConnection(IrcConnection): try: msg = self._q_server_msgs.get(timeout=0.1) except QueueEmpty: - break + yield None yield self._make_recv_event(IrcMessage.from_raw(msg)) @@ -123,11 +123,9 @@ class TestingClientTui(ClientTui): while True: self._playbook_idx += 1 line = self._playbook[self._playbook_idx] - if not line.strip(): + if line[:1] == '#' or not line.strip(): continue context, msg = line.split(' ', maxsplit=1) - if context == '#': - continue if context == '>': for c in msg: self._q_keypresses.put(c)