home · contact · privacy
With new test logging output, misleading line idx display on AssertionError no longer... master
authorChristian Heller <c.heller@plomlompom.de>
Wed, 8 Oct 2025 21:46:42 +0000 (23:46 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 8 Oct 2025 21:46:42 +0000 (23:46 +0200)
src/ircplom/testing.py

index 253a1ebf235c38c3555e40b61e9145c84af6d632..71b78dc1fa885770f19a5e25a2d862618d9e6110 100644 (file)
@@ -214,17 +214,16 @@ class _Playbook:
         if self._idx == 0:
             self._play_till_log()
 
         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)
         '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()
         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:
 
     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] == ':'
         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
                 'GOT:', win_ids, msg_sans_time)
         assert expected_msg == msg_sans_time, info
         assert expected_win_ids == win_ids, info