Use Docker to test the iLovePDF Python library across multiple Python versions (3.10 to 3.14) in isolated environments.
cp .env.example .envEdit .env with your API credentials from iLovePDF Developer Portal:
ILOVEPDF_PUBLIC_KEY=your_public_key_here
ILOVEPDF_SECRET_KEY=your_secret_key_hereImportant: Never commit .env with real credentials.
docker-compose -f .docker/docker-compose.yml builddocker-compose -f .docker/docker-compose.yml run --rm python310# Unit tests only
docker-compose -f .docker/docker-compose.yml run --rm python310 pytest tests/unit
# Integration tests only
docker-compose -f .docker/docker-compose.yml run --rm python310 pytest tests/integration
# Specific test file
docker-compose -f .docker/docker-compose.yml run --rm python310 pytest tests/unit/test_compress_task.pyAvailable: python310, python311, python312, python313, python314
docker-compose -f .docker/docker-compose.yml run --rm python312 pytest tests/unitdocker-compose -f .docker/docker-compose.yml build python310docker-compose -f .docker/docker-compose.yml build --no-cache python310docker-compose -f .docker/docker-compose.yml run --rm python310 bashIf you see "the input device is not a TTY", add -T flag:
docker-compose -f .docker/docker-compose.yml run --rm -T python310 pytest tests/unitRebuild the image:
docker-compose -f .docker/docker-compose.yml build python310- Verify
.envfile exists in project root with valid credentials - Check you copied it from
.env.example - Integration tests require valid API credentials
- Main documentation: ../README.md
- API docs: developer.ilovepdf.com/docs