Skip to content

Добавила тесты на проверку методов#1

Open
LobanovaLM wants to merge 4 commits intomainfrom
develop
Open

Добавила тесты на проверку методов#1
LobanovaLM wants to merge 4 commits intomainfrom
develop

Conversation

@LobanovaLM
Copy link
Owner

No description provided.

conftest.py Outdated

@pytest.fixture(scope = 'function')
def books_collect():
from main import BooksCollector
Copy link

Choose a reason for hiding this comment

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

нужно испраить - перенести импорты на первые строки файла

Copy link
Owner Author

Choose a reason for hiding this comment

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

вынесла в начала файла

@pytest.fixture(scope = 'function')
def books_collect():
from main import BooksCollector
books_collect = BooksCollector()
Copy link

Choose a reason for hiding this comment

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

Отлично: в каждом тесте создается собственный экземпляр BooksCollector

test.py Outdated
'Убийство в Восточном экспрессе': 'Детективы',
'Кладбище домашних животных': 'Ужасы',
'Вокруг света за 80 дней': 'Фантастика',
'Оно': 'Ужасы'
Copy link

Choose a reason for hiding this comment

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

нужно исправить: одни и те же значения повторяются, так легко ошибиться - нужно создать файл с тестовыми данными и переиспользовать

Copy link
Owner Author

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