Conversation
Melevir
reviewed
May 28, 2023
| ] | ||
| ) | ||
|
|
||
|
|
| from typing import NamedTuple | ||
|
|
||
| # ВОПРОС: | ||
| # В таких случаях, как этот, нужен ли параметрайз? |
Contributor
There was a problem hiding this comment.
Так у тебя тут один тест, нечего параметрайзить :)
| ("verb_male", "verb_female", '254654', "verb_female"), | ||
| ] | ||
| ) | ||
|
|
Contributor
There was a problem hiding this comment.
Ну и дальше они тоже есть у параметрайзов
| def test_build_url(): | ||
| pass | ||
| @pytest.mark.parametrize( | ||
| "host_name, relative_url, get_params, expected_result", |
| # 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 на ==, теперь тесты проходят. | ||
| # Вопрос: это такая особенность дататайма, или почему так произошло? |
Contributor
There was a problem hiding this comment.
== проверяет объекты на равенство, а is – на то, что объекты указывают на одну и ту же область в памяти.
is обычно используют когда сравнивают с None/True/False.
| assert first(NOT_SET) == 'N' | ||
|
|
||
|
|
||
| def test__first__items_is_empty_no_defaults_attributeerror(): |
Contributor
There was a problem hiding this comment.
Этот и следующие тесты тоже объединить бы
| 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: |
| ] | ||
| ) | ||
|
|
||
| def test__replace_word__is_valif(text, replace_from, replace_to, expected_result): |
| assert replace_word(text, replace_from, replace_to) == expected_result | ||
|
|
||
|
|
||
| def test__replace_word__replace_to_is_int_typeerror(): |
| def test__get_median__is_valid(items, expected_result): | ||
| assert get_median_value(items) is expected_result | ||
|
|
||
| def test__get_median_value__empty_params(): |
Contributor
There was a problem hiding this comment.
Этот тест не нужен, он есть в наборе выше
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Это пока дз со 2ой недели
Исправила мелкие недочёты вроде пробелов и ванлайнеров