This project demonstrates how to perform unit testing for SQL queries using Python. The goal is to ensure the accuracy and reliability of SQL logic used in data processing and analytics. The project leverages pytest for testing, SQLAlchemy for database interaction, and GitHub Actions for CI/CD.
- Python 3.12
- pip
-
Clone the repository
git clone https://github.com/bernatsort/sql-unit-testing-python.git cd sql-unit-testing-python
-
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies
pip install --upgrade pip pip install pytest sqlalchemy pandas openpyxl
- Run all tests
pytest
The project uses GitHub Actions for continuous integration. The CI pipeline is configured to:
- Checkout the repository
- Set up Python 3.12
- Install dependencies