This project demonstrates the use of testcontainers-python for integration testing with Docker containers, specifically testing a Redis connection. The project uses GitHub Actions for continuous integration with the fast uv package installer.
- Uses
testcontainers-pythonto spin up a Redis container for testing - Implements a simple Redis connection test
- GitHub Actions workflow with
uvfor fast dependency installation - Automatic container cleanup after tests
- Python 3.11+
- Docker
uv(optional, for faster package installation)
- Clone the repository:
git clone <your-repo-url>
cd <repo-name>- Install dependencies:
# Using pip
pip install -r requirements.txt
# Or using uv (faster)
uv pip install -r requirements.txtRun the tests using pytest:
pytest -vThe project includes a GitHub Actions workflow that:
- Runs on push to main and pull requests
- Uses
uvfor fast dependency installation - Automatically runs the test suite
MIT