This repository showcases an approach to unit testing for the BooksCollector application. The project implements a scalable testing architecture with deep reporting and automated validation. The test suite ensures 100% reliability of core features: book inventory, genre categorization (including age-rating logic), and user favorites management.
- Language: Python 3.10+
- Testing:
pytest(utilizing fixtures, parametrization, and clean code principles) - Reporting:
Allure Framework(rich, human-readable HTML reports) - CI/CD:
GitHub Actions(automated test execution on every push)
The project is organized to ensure clean code separation and transparency:
Sprint_4/
├── .github/workflows/ # CI/CD pipeline configuration (GitHub Actions)
├── allure-results/ # Raw test execution data (generated after run)
├── main.py # Core application logic (BooksCollector class)
├── tests.py # Unit test suite with Allure annotations & fixtures
├── requirements.txt # List of project dependencies
└── README.md # Comprehensive project documentation
I have integrated the Allure Framework to provide high-level visibility into test execution and simplify debugging:
- Dynamic Test Titles: Uses
@allure.titleto generate descriptive, human-readable test names that automatically update based on input parameters. - Granular Execution Steps: Implements
@allure.stepannotations to track the logic flow within each test, making it easy to pinpoint exactly where a failure occurred. - Logical Test Suites: Categorizes tests into functional suites using
@allure.suitefor better navigation and structured analysis of the test results. - Environment Details: Provides a clear overview of the test environment and execution parameters.
Clone the repository and set up a local virtual environment to ensure dependency isolation:
- Clone repository
git clone https://github.com/AlyaSmirnova/Sprint_4 cd Sprint_4
📦 Repository: Sprint_4
- Create a virtual environment
python -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install required dependencies
$ pip install -r requirements.txt
Execute the full test suite and collect raw data for the Allure report:
pytest -v --alluredir=allure-results
Transform the raw data into a visual, interactive HTML report:
allure serve allure-results