This repository demonstrates a simple setup for testing Python code using Pytest and Tox within a Docker environment.
.
├── Dockerfile # Docker setup for Python environment
├── docker-compose.yml # Docker Compose configuration
├── requirements.txt # Python dependencies (Pytest and Tox)
├── main.py # Main Python file with functions to test
├── test_main.py # Pytest tests for the main.py functions
└── tox.ini # Tox configuration for running tests in different environments
Make sure you have Docker and Docker Compose installed on your system.
git clone https://github.com/yourusername/PyTestandTox.git
cd PyTestandTox
docker-compose build
This command will run tests across all the Python environments specified in tox.ini.
docker-compose up
If you prefer to run tests directly with Pytest:
docker-compose run pytest-tox pytest