This is sample code for Getting started with Testcontainers for Python guide.
- Make sure you have a compatible Docker environment installed.
- Python 3.12+ installed.
For example:
$ python --version
Python 3.12.0
- Clone the repository
git clone https://github.com/testcontainers/tc-guide-getting-started-with-testcontainers-for-python.git
cd tc-guide-getting-started-with-testcontainers-for-python
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Open the tc-guide-getting-started-with-testcontainers-for-python project in your favorite IDE.
Run the command to run the tests.
$ pytest
The tests should pass.