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'# </${_MARK_INSERT}>')]
+ new_lines_t += [('', f'# </{_MARK_INSERT}>')]
replacement_happened = True
else:
new_lines_t += [line_t]
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:
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
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):