diff --git a/src/robotlibcore.py b/src/robotlibcore.py index 6eec23d..f0fe0b3 100644 --- a/src/robotlibcore.py +++ b/src/robotlibcore.py @@ -83,7 +83,7 @@ def add_library_components(self, library_components: List, translation: Optional self.attributes[name] = self.attributes[kw_name] = kw def __get_keyword_name(self, func: Callable, name: str, translation: dict): - if name in translation: + if name in translation: # noqa: SIM102 if new_name := translation[name].get("name"): return new_name return func.robot_name or name @@ -236,7 +236,7 @@ def build(cls, function, translation: Optional[dict] = None): @classmethod def get_doc(cls, function, translation: dict): - if kw := cls._get_kw_transtation(function, translation): + if kw := cls._get_kw_transtation(function, translation): # noqa: SIM102 if "doc" in kw: return kw["doc"] return inspect.getdoc(function) or "" diff --git a/utest/test_translations.py b/utest/test_translations.py index cff47c6..2d009b0 100644 --- a/utest/test_translations.py +++ b/utest/test_translations.py @@ -28,6 +28,7 @@ def test_translations_docs(lib: SmallLibrary): kw = keywords["name_changed_again"] assert kw.documentation == "This is also replaced.\n\nnew line." + def test_init_and_lib_docs(lib: SmallLibrary): keywords = lib.keywords_spec init = keywords["__init__"]