From: Christian Heller Date: Mon, 8 Dec 2025 00:52:35 +0000 (+0100) Subject: Fix some minor testing log output irregularities. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/tasks?a=commitdiff_plain;h=42ea7cc715bab8e3a99bf0e4f9522975ec88d704;p=ircplom Fix some minor testing log output irregularities. --- diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index e954b36..e855a12 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -335,7 +335,7 @@ class _Playbook: if cmd_name == _MARK_INSERT: new_lines_t += [('', f'# <{line_t[1]}>')] new_lines_t += insert(line_t[0], args, fragments) - new_lines_t += [('', f'# ')] + new_lines_t += [('', f'# ')] replacement_happened = True else: new_lines_t += [line_t] @@ -439,9 +439,11 @@ class _Playbook: if self._idx == next_idx_before: # f may call ._play_till_test, so self._play_till_test() # only call if that didn't happen except AssertionError as e: - for line in self._print_on_fail: - print(line) - print(f'FAILED: {self._path}') + if self._print_on_fail: + for line in self._print_on_fail: + print(line) + self._print_on_fail.clear() # to not re-print if called nested + print(f'FAILED: {self._path}') raise e def _play_till_test(self) -> None: @@ -467,6 +469,7 @@ class _Playbook: break if cmd_name == _MARK_LOG: break + self._idx += 1 if cmd_name == _MARK_SCREENLINE: assert self.assert_screen_line is not None assert self.redraw_affected is not None @@ -474,7 +477,6 @@ class _Playbook: self.assert_screen_line(int(args[0]), int(args[1]), *args[2:]) elif cmd_name == _MARK_WAIT: sleep(int(args[0])) - self._idx += 1 class TestingClientTui(ClientTui):