From: Christian Heller Date: Wed, 8 Oct 2025 21:46:42 +0000 (+0200) Subject: With new test logging output, misleading line idx display on AssertionError no longer... X-Git-Url: https://plomlompom.com/repos/do_tasks?a=commitdiff_plain;ds=inline;p=ircplom With new test logging output, misleading line idx display on AssertionError no longer needed. --- diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index 253a1eb..71b78dc 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -214,17 +214,16 @@ class _Playbook: if self._idx == 0: self._play_till_log() - def next_log(self) -> tuple[int, tuple[int, ...], str]: + def next_log(self) -> tuple[tuple[int, ...], str]: 'Return index, win IDs, and context of next expected log line.' context, msg = self._split_by_context_separator(self._current_line[1]) if _CHAR_RANGE in context: _, context = context.split(_CHAR_RANGE) expected_win_ids = tuple( int(idx) for idx in context.split(_CHAR_WIN_ID_SEP) if idx) - used_idx = self._idx self._idx += 1 self._play_till_log() - return used_idx, expected_win_ids, msg + return expected_win_ids, msg def _play_till_log(self) -> None: while True: @@ -301,9 +300,8 @@ class TestingClientTui(ClientTui): for c in time_str[:2] + time_str[3:5] + time_str[6:]: assert c.isdigit() assert time_str[2] == ':' and time_str[5] == ':' - idx, expected_win_ids, expected_msg = self._playbook.next_log() - info = (idx, - 'WANTED:', expected_win_ids, expected_msg, + expected_win_ids, expected_msg = self._playbook.next_log() + info = ('WANTED:', expected_win_ids, expected_msg, 'GOT:', win_ids, msg_sans_time) assert expected_msg == msg_sans_time, info assert expected_win_ids == win_ids, info