Skip to content

Sprint_4#7

Open
EvaV21 wants to merge 5 commits intomainfrom
develop
Open

Sprint_4#7
EvaV21 wants to merge 5 commits intomainfrom
develop

Conversation

@EvaV21
Copy link
Owner

@EvaV21 EvaV21 commented Feb 12, 2026

No description provided.

tests.py Outdated
assert len(collector.get_books_genre()) == 2

def test_add_new_book_name_more_40_symbols_not_added(self):
collector = BooksCollector()

Choose a reason for hiding this comment

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

Можно улучшить: общее для всех тестов предусловие можно вынести в фикстуру

tests.py Outdated
collector.add_new_book('Оно')
collector.set_book_genre('Оно', 'Ужасы')

assert collector.get_book_genre('Оно') == 'Ужасы'

Choose a reason for hiding this comment

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

Нужно исправить: для get_book_genre должен быть отдельный тест. Тесты не должны дублировать друг друга. В идеале - чтобы в каждом тесте использовался только один проверяемый метод, все остальное можно получить прямым доступом к словарям и спискам

tests.py Outdated
collector.add_new_book('Оно')
collector.add_book_in_favorites('Оно')

assert collector.get_list_of_favorites_books() == ['Оно']

Choose a reason for hiding this comment

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

Нужно исправить: для получения списка избранного тоже нужен отдельный тест

tests.py Outdated


class TestBooksCollector:
@pytest.fixture

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