From 0bee780daa3ff115d3a12253c9758d1b6ffdc14b Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 21 Nov 2024 11:05:37 +0100 Subject: [PATCH] fixup! feat(tests): simplify asserts on translated strings --- tests/translations.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/translations.py b/tests/translations.py index fcfd638d77..afb12a5fec 100644 --- a/tests/translations.py +++ b/tests/translations.py @@ -129,4 +129,7 @@ def regexp(key: str) -> re.Pattern: def __getattr__(key: str) -> str: - return translate(key, _stacklevel=1) + try: + return translate(key, _stacklevel=1) + except KeyError as e: + raise AttributeError(f"Translation key '{key}' not found") from e