Skip to content

Conversation

@DianaRatnikova
Copy link

Это пока дз со 2ой недели
Исправила мелкие недочёты вроде пробелов и ванлайнеров

]
)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пустые строки лишние

from typing import NamedTuple

# ВОПРОС:
# В таких случаях, как этот, нужен ли параметрайз?
Copy link
Contributor

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"),
]
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Опять лишняя строка

Copy link
Contributor

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",
Copy link
Contributor

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 на ==, теперь тесты проходят.
# Вопрос: это такая особенность дататайма, или почему так произошло?
Copy link
Contributor

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():
Copy link
Contributor

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:
Copy link
Contributor

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):
Copy link
Contributor

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():
Copy link
Contributor

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():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот тест не нужен, он есть в наборе выше

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants