Advertisement
Guest User

Untitled

a guest
Feb 11th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. import os.path
  2.  
  3. import pytest
  4. from compose.cli.main import TopLevelCommand, project_from_options
  5.  
  6. @pytest.fixture(scope="session")
  7. def docker_compose(request):
  8.     """
  9.    :type request: _pytest.python.FixtureRequest
  10.    """
  11.  
  12.     options = {"--no-deps": False,
  13.                "--abort-on-container-exit": False,
  14.                "SERVICE": "",
  15.                "--remove-orphans": False,
  16.                "--no-recreate": True,
  17.                "--force-recreate": False,
  18.                "--build": False,
  19.                '--no-build': False,
  20.                '--no-color': False,
  21.                "--rmi": "none",
  22.                "--volumes": "",
  23.                "--follow": False,
  24.                "--timestamps": False,
  25.                "--tail": "all",
  26.                "-d": True,
  27.                }
  28.  
  29.     project = project_from_options(os.path.dirname(__file__), options)
  30.     cmd = TopLevelCommand(project)
  31.     cmd.up(options)
  32.  
  33.     def fin():
  34.         cmd.logs(options)
  35.         cmd.down(options)
  36.  
  37.     request.addfinalizer(fin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement