From 0ab991f64ed88cd0a8306056872c5aa276d224b3 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 10 Nov 2025 04:36:20 +0100 Subject: [PATCH] On testing scripts insert resolution, don't insert any file more than once. --- src/ircplom/testing.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index a8026a9..b6efa67 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -250,6 +250,9 @@ class _Playbook: assert len(insert_args) in (1, 2, 3, 5), (idx_str, insert_args) if len(insert_args) == 1 and insert_args[0].startswith(_TOK_FILE): + if insert_args[0] in inserted_files: + return [] + inserted_files.add(insert_args[0]) return lines_t_from_file(PATH_TESTS.joinpath(insert_args[0]), f'{idx_str}{_TOK_FILE}{_SEP_2}') candidates = [ @@ -265,6 +268,7 @@ class _Playbook: return [(c[0], c[1]) for c in candidates] self._lines_t = lines_t_from_file(path) + inserted_files: set[str] = set() while True: fragments: dict[str, tuple[tuple[str, str], ...]] = {} anchor = '' -- 2.30.2