home · contact · privacy
On test failure, don't just output passed lines, but also what file they belong to.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 11 Nov 2025 16:11:24 +0000 (17:11 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 11 Nov 2025 16:11:24 +0000 (17:11 +0100)
src/ircplom/testing.py

index b6efa6715f15d261cd7c829d2761883e6110faa6..b03b12feb131838786c137f72fa39fb6f5fb067c 100644 (file)
@@ -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: