mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-08-23 07:51:56 +00:00
tests: DockerComposer contextmanager do not fail
Change pytest.fail to a logging error because pytest.fail makes DockerComposer ContextManager exit and no _down teardown is executed.
This commit is contained in:
@@ -321,11 +321,11 @@ def __prepare_and_execute_compose_cmd(compose_files: List[str], project_name: st
|
|||||||
compose_cmd.write(f" --file {compose_file}")
|
compose_cmd.write(f" --file {compose_file}")
|
||||||
compose_cmd.write(f" {cmd}")
|
compose_cmd.write(f" {cmd}")
|
||||||
|
|
||||||
logging.info(compose_cmd.getvalue())
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(shlex.split(compose_cmd.getvalue()), stderr=subprocess.STDOUT)
|
subprocess.check_output(shlex.split(compose_cmd.getvalue()), stderr=subprocess.STDOUT)
|
||||||
|
logging.info(f"Executed '{compose_cmd.getvalue()}'")
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
pytest.fail(f"Error while running '{compose_cmd.getvalue()}':\n{e.output}", pytrace=False)
|
logging.error(f"Error while running '{compose_cmd.getvalue()}'")
|
||||||
|
|
||||||
|
|
||||||
def docker_compose_up(compose_files: List[str], project_name: str):
|
def docker_compose_up(compose_files: List[str], project_name: str):
|
||||||
|
Reference in New Issue
Block a user