From 85370fa31f94a52876e11594d2337cd38e585f2a Mon Sep 17 00:00:00 2001 From: Thomas LEVEIL Date: Tue, 14 Feb 2017 22:30:20 +0100 Subject: [PATCH] TESTS: improve error reporting for failed to run `docker-compose` commands --- test/conftest.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index 4bba4be..fcff6ea 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -263,18 +263,18 @@ def get_nginx_conf_from_container(container): def docker_compose_up(compose_file='docker-compose.yml'): logging.info('docker-compose -f %s up -d' % compose_file) try: - subprocess.check_output(shlex.split('docker-compose -f %s up -d' % compose_file)) + subprocess.check_output(shlex.split('docker-compose -f %s up -d' % compose_file), stderr=subprocess.STDOUT) except subprocess.CalledProcessError, e: - logging.error("Error while runninng 'docker-compose -f %s up -d':\n%s" % (compose_file, e.output)) - raise + pytest.fail("Error while runninng 'docker-compose -f %s up -d':\n%s" % (compose_file, e.output), pytrace=False) + def docker_compose_down(compose_file='docker-compose.yml'): logging.info('docker-compose -f %s down' % compose_file) try: - subprocess.check_output(shlex.split('docker-compose -f %s down' % compose_file)) + subprocess.check_output(shlex.split('docker-compose -f %s down' % compose_file), stderr=subprocess.STDOUT) except subprocess.CalledProcessError, e: - logging.error("Error while runninng 'docker-compose -f %s down':\n%s" % (compose_file, e.output)) - raise + pytest.fail("Error while runninng 'docker-compose -f %s down':\n%s" % (compose_file, e.output), pytrace=False) + def wait_for_nginxproxy_to_be_ready(): """