August 2018
Beginner
160 pages
4h 8m
English
This plugin starts and manages Docker services you need in order to test your code. This makes it simple to run the tests because you don't need to manually start the services yourself; the plugin will start and stop them during the test session, as needed.
You configure the services using a .services.yaml file; here is a simple example:
database: image: postgres environment: POSTGRES_USERNAME: pytest-user POSTGRES_PASSWORD: pytest-pass POSTGRES_DB: test image: regis:10
This will start two services: postgres and redis.
With that, all that's left to do is to run your suite with the following:
pytest --docker-services
The plugin takes care of the rest.
Read now
Unlock full access