-
Notifications
You must be signed in to change notification settings - Fork 55
Edit3 #11
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?
Edit3 #11
Conversation
| ] | ||
| ) | ||
|
|
||
|
|
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 typing import NamedTuple | ||
|
|
||
| # ВОПРОС: | ||
| # В таких случаях, как этот, нужен ли параметрайз? |
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.
Так у тебя тут один тест, нечего параметрайзить :)
| ("verb_male", "verb_female", '254654', "verb_female"), | ||
| ] | ||
| ) | ||
|
|
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.
Ну и дальше они тоже есть у параметрайзов
| def test_build_url(): | ||
| pass | ||
| @pytest.mark.parametrize( | ||
| "host_name, relative_url, get_params, expected_result", |
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.
Отступы потерялись
| # AssertionError: assert datetime.datetime(2023, 5, 28, 19, 55) is datetime.datetime(2023, 5, 28, 19, 55) | ||
| # + where datetime.datetime(2023, 5, 28, 19, 55) = compose_datetime_from('tomorrow', '19:55') | ||
| # Заменила is на ==, теперь тесты проходят. | ||
| # Вопрос: это такая особенность дататайма, или почему так произошло? |
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.
== проверяет объекты на равенство, а is – на то, что объекты указывают на одну и ту же область в памяти.
is обычно используют когда сравнивают с None/True/False.
| assert first(NOT_SET) == 'N' | ||
|
|
||
|
|
||
| def test__first__items_is_empty_no_defaults_attributeerror(): |
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_5.five_replace_word import replace_word | ||
| import pytest | ||
|
|
||
| def replace_word(text: str, replace_from: str, replace_to: str) -> str: |
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.
Это тут точно лишнее :)
| ] | ||
| ) | ||
|
|
||
| def test__replace_word__is_valif(text, replace_from, replace_to, expected_result): |
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.
Очипятка в названии
| assert replace_word(text, replace_from, replace_to) == expected_result | ||
|
|
||
|
|
||
| def test__replace_word__replace_to_is_int_typeerror(): |
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.
И эти тесты бы объединить
| def test__get_median__is_valid(items, expected_result): | ||
| assert get_median_value(items) is expected_result | ||
|
|
||
| def test__get_median_value__empty_params(): |
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.
Этот тест не нужен, он есть в наборе выше
Это пока дз со 2ой недели
Исправила мелкие недочёты вроде пробелов и ванлайнеров