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