This repository demonstrates unit testing, code coverage analysis, and CI automation using Python.
It is part of my DevOps & Cloud Computing practice to understand how testing integrates into real-world CI/CD pipelines.
- Writing unit tests using pytest
- Measuring code coverage with coverage.py
- Generating HTML coverage reports
- Uploading coverage to CI tools (Codecov / GitHub Actions)
- Structuring Python projects for testing
- Automating tests in CI pipeline
Testings/
│
├── src/ # Application source code
├── tests/ # Unit tests
├── .github/workflows # CI pipeline configuration
├── requirements.txt # Dependencies
└── README.md
A simple Python calculator supporting:
- Addition
- Subtraction
- Multiplication
- Division (with error handling)
Install dependencies:
pip install -r requirements.txt
Run tests:
pytest
Run tests with coverage:
pytest --cov=src
Generate HTML report:
pytest --cov=src --cov-report=html
Open coverage report:
htmlcov/index.html
This repository uses GitHub Actions to:
- Install dependencies
- Run tests automatically
- Generate coverage report
- Upload results to coverage tools
You can view pipeline runs in:
GitHub → Actions tab
- Understood testing workflow in Python projects
- Learned coverage metrics and reports
- Practiced CI pipeline automation
- Improved code reliability mindset
- Built portfolio-ready DevOps project
Jay Gupta DevOps & Cloud Learner (PW Skills)
⭐ Star this repo if you find it useful!