From 74aee7b470fa36c40a75a57ed76aed1079057851 Mon Sep 17 00:00:00 2001 From: bashrc Date: Tue, 5 May 2026 18:12:36 +0100 Subject: [PATCH] Avoid detecting translations within translations test function --- tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests.py b/tests.py index 53ef7d436..5cf031931 100644 --- a/tests.py +++ b/tests.py @@ -4869,6 +4869,9 @@ def _test_translation_labels() -> None: print('test_translation_labels') lang_json = load_json('translations/en.json') assert lang_json + # NOTE: the splitting up into two strings here is deliberate + # to avoid analysis within this function + translate_str = 'translate' + '[' for _, _, files in os.walk('.'): for source_file in files: if not source_file.endswith('.py'): @@ -4883,9 +4886,9 @@ def _test_translation_labels() -> None: source_file) if not source_str: continue - if 'translate[' not in source_str: + if translate_str not in source_str: continue - sections: list[str] = source_str.split('translate[') + sections: list[str] = source_str.split(translate_str) ctr: int = 0 for text in sections: if ctr == 0: