From 3104448f5adc8c7d72a2eb1cc4607d21acef9be0 Mon Sep 17 00:00:00 2001 From: Sourcery AI Date: Wed, 10 Jun 2020 11:56:28 +0000 Subject: [PATCH] Refactored by Sourcery --- test/conftest.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index 43f83bbc3..a14369f7d 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -437,20 +437,18 @@ def nginxproxy(): # pytest hook to display additionnal stuff in test report def pytest_runtest_logreport(report): - if report.failed: - if isinstance(report.longrepr, ReprExceptionInfo): - test_containers = docker_client.containers.list(all=True, filters={"ancestor": "jwilder/nginx-proxy:test"}) - for container in test_containers: - report.longrepr.addsection('nginx-proxy logs', container.logs()) - report.longrepr.addsection('nginx-proxy conf', get_nginx_conf_from_container(container)) + if report.failed and isinstance(report.longrepr, ReprExceptionInfo): + test_containers = docker_client.containers.list(all=True, filters={"ancestor": "jwilder/nginx-proxy:test"}) + for container in test_containers: + report.longrepr.addsection('nginx-proxy logs', container.logs()) + report.longrepr.addsection('nginx-proxy conf', get_nginx_conf_from_container(container)) # Py.test `incremental` marker, see http://stackoverflow.com/a/12579625/107049 def pytest_runtest_makereport(item, call): - if "incremental" in item.keywords: - if call.excinfo is not None: - parent = item.parent - parent._previousfailed = item + if "incremental" in item.keywords and call.excinfo is not None: + parent = item.parent + parent._previousfailed = item def pytest_runtest_setup(item):