-
Notifications
You must be signed in to change notification settings - Fork 55
Level 1.5 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Level 1.5 #9
Conversation
Melevir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ссылку на пул-реквест лучше сдавать на проверку вот так: #9
А ещё видишь learnpythonru в ссылке на пул-реквест? Это значит, что ты сделал пул-реквест не в свой репозиторий, а Лёрновский. Лучше делать в свой. Этим можно управлять когда на Гитхабе создаёшь пул-реквест.
| assert change_copy_item('Banana') == 'Copy of Banana' | ||
| assert change_copy_item('Copy of Banana') == 'Copy of Banana (2)' | ||
| assert change_copy_item('Copy of Banana (7)') == 'Copy of Banana (8)' | ||
| assert change_copy_item('Banana', 5) == 'Banana' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему-то в одном тесте собраны четыре разные теста. Разделить бы.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Актуально для почти всех тестов ниже
| from functions.level_1.five_title import change_copy_item | ||
|
|
||
|
|
||
| def test_change_copy_item(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут и дальше название тестов так себе
| spent_in="MEWWALLET", | ||
| spent_at=datetime.datetime.strptime("18.05.23 23:59", "%d.%m.%y %H:%M"), | ||
| ) | ||
| assert parse_ineco_expense(sms, cards) == expected_output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Разбить бы по AAA
| bad_words = {'hate', 'fucking'} | ||
| assert check_tweet_sentiment(text, good_words, bad_words) == None | ||
|
|
||
| def test__check_tweet_sentiment__normal_expecting_BAD_response(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Капс в названиях тестов лучше не использовать
| import pytest | ||
|
|
||
|
|
||
| """Хотелось бы сразу заметить, что функция и нормальные тесты невозможны""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Во-первых, комментарий в формате докстринги принято ставить сразу после дефа. Этот комментарий нужно писать с помощью решётки. Сейчас это строковой литерал.
Во-вторых, в этом комментарии пропущено слово и можно на изи неправильно его понять.
Ну и в-третьих очень даже возможно написать нормальные тесты на функцию с багом.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут я бы ещё кейсов поискал
No description provided.