style: fix 2 instances of lines that are too long (#2512)

* Issue-2499: fix 2 instances of lines that are too long

* Issue-2499: Formatting expected output in yaml loader and adding normalize whitespace to pytest config
This commit is contained in:
rsk2 2022-10-29 13:06:47 +05:30 committed by GitHub
parent 66622cb22c
commit 116e6c697a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -170,7 +170,6 @@ def _convert_word(raw_word) -> Word:
)
# pylint: disable=line-too-long
def _convert_words(raw_words: List[Word]) -> List[Word]:
"""
Converts each YAML word definition into Word() objects
@ -187,12 +186,16 @@ def _convert_words(raw_words: List[Word]) -> List[Word]:
... 'Also accepted': ['the female']
... }
... ])
[Word(in_target_language=["l'homme"], in_source_language=['the man'], pictures=['man1', 'man2', 'man3']), Word(in_target_language=['la femme', 'la dame'], in_source_language=['the woman', 'the female'], pictures=None)]
[Word(in_target_language=["l'homme"],
in_source_language=['the man'],
pictures=['man1', 'man2', 'man3']),
Word(in_target_language=['la femme', 'la dame'],
in_source_language=['the woman', 'the female'],
pictures=None)]
"""
return list(map(_convert_word, raw_words))
# pylint: disable=line-too-long
def _convert_phrase(raw_phrase) -> Phrase:
"""
Converts a YAML phrase definition into a Phrase() object
@ -202,7 +205,8 @@ def _convert_phrase(raw_phrase) -> Phrase:
... 'Translation': 'The woman says hello',
... 'Alternative translations': ['The woman says hi']
... })
Phrase(in_target_language=['La femme dit bonjour', 'la femme dit salut'], in_source_language=['The woman says hello', 'The woman says hi'])
Phrase(in_target_language=['La femme dit bonjour', 'la femme dit salut'],
in_source_language=['The woman says hello', 'The woman says hi'])
"""
try:
return Phrase(

View File

@ -1,2 +1,3 @@
[pytest]
norecursedirs = node_modules apps/web apps/docs apps/lluis apps/answer-corrector .*
doctest_optionflags = NORMALIZE_WHITESPACE