Last active
October 31, 2020 16:23
-
-
Save goujonbe/29a9c4781f536c2b8423697f03a5dbfc to your computer and use it in GitHub Desktop.
Gist that is part of a tutorial on pytest features. About logging testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def translate_animal_names( | |
| animals: List[str], | |
| translations: Dict[str, str] | |
| ) -> List[str]: | |
| translated_animal_names = [] | |
| for animal in animals: | |
| if animal in translations: | |
| translated_animal_names.append(translations[animal]) | |
| else: | |
| logging.warning( | |
| "'%s' is not present in the translations provided.", | |
| animal | |
| ) | |
| return translated_animal_names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment