Skip to content

Conversation

@MagerOK
Copy link

@MagerOK MagerOK commented May 25, 2023

No description provided.

Copy link
Contributor

@Melevir Melevir left a 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'
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.

Актуально для почти всех тестов ниже

from functions.level_1.five_title import change_copy_item


def test_change_copy_item():
Copy link
Contributor

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

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

Choose a reason for hiding this comment

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

Капс в названиях тестов лучше не использовать

import pytest


"""Хотелось бы сразу заметить, что функция и нормальные тесты невозможны"""
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.

Тут я бы ещё кейсов поискал

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