Files
python_parser/tests/README.md
2025-09-04 18:56:36 +03:00

45 lines
1.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Тесты для парсеров
Этот каталог содержит pytest тесты для всех парсеров и их геттеров.
## Структура
- est_parsers.py - Основные тесты для всех парсеров
- conftest.py - Конфигурация pytest
-
equirements.txt - Зависимости для тестов
- est_data/ - Тестовые данные
## Запуск тестов
`ash
# Установка зависимостей
pip install -r tests/requirements.txt
# Запуск всех тестов
pytest tests/
# Запуск конкретного теста
pytest tests/test_parsers.py::TestSvodkaPMParser
# Запуск с подробным выводом
pytest tests/ -v
# Запуск с покрытием кода
pytest tests/ --cov=python_parser
`
## Покрытие тестами
Тесты покрывают:
- Инициализацию всех парсеров
- Все геттеры каждого парсера
- Обработку валидных и невалидных параметров
- Интеграционные тесты
## Добавление новых тестов
При добавлении нового парсера:
1. Добавьте класс тестов в est_parsers.py
2. Создайте тесты для всех геттеров
3. Добавьте парсер в интеграционные тесты