Created
April 24, 2019 14:27
-
-
Save wshayes/4e7ae0ea8a582ba9e6468125bddbdaca to your computer and use it in GitHub Desktop.
Running docker servers in pytest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of code to startup docker containers for use in the tests | |
# pip install pytest-docker-tools | |
from pytest_docker_tools import container, fetch | |
arangodb_image = fetch(repository="arangodb:3.4") | |
elasticsearch_image = fetch(repository="elasticsearch:6.7.1") | |
arangodb_session = container( | |
image="{arangodb_image.id}", | |
name="pytest_arangodb", | |
scope="session", | |
ports={"8529/tcp": 18529}, | |
environment={"ARANGO_NO_AUTH": True}, | |
) | |
elasticsearch_session = container( | |
image="{elasticsearch_image.id}", | |
name="pytest_elasticsearch", | |
scope="session", | |
ports={"9200/tcp": 19200}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment