From: Christian Heller Date: Tue, 11 Nov 2025 16:11:24 +0000 (+0100) Subject: On test failure, don't just output passed lines, but also what file they belong to. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/move_down?a=commitdiff_plain;h=10a2887e7a3218b098c400a4093976299b959f36;p=ircplom On test failure, don't just output passed lines, but also what file they belong to. --- diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index b6efa67..b03b12f 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -191,6 +191,7 @@ class _Playbook: def __init__(self, path: Path, get_client: Callable, verbose: bool ) -> None: + self._path = path self._get_client = get_client self._verbose = verbose self._print_on_fail: list[str] = [] @@ -267,7 +268,7 @@ class _Playbook: bump_int_fields(int(insert_args[2])) return [(c[0], c[1]) for c in candidates] - self._lines_t = lines_t_from_file(path) + self._lines_t = lines_t_from_file(self._path) inserted_files: set[str] = set() while True: fragments: dict[str, tuple[tuple[str, str], ...]] = {} @@ -392,6 +393,7 @@ class _Playbook: except AssertionError as e: for line in self._print_on_fail: print(line) + print(f'FAILED: {self._path}') raise e def _play_till_test(self) -> None: