From 6daf83aa14e6793cb1080d27948b322400016bfd Mon Sep 17 00:00:00 2001 From: Younes Khoudli Date: Fri, 22 Nov 2024 10:51:20 +0100 Subject: [PATCH] wip: investigate integration test flakiness --- tests/conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 0b1adea239f..9685c6176b3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,6 +13,17 @@ from tests.utils.timetable import create_scenario +def raise_for_status_logging_body(response: requests.Response): + try: + return response.raise_for_status() + except requests.exceptions.HTTPError as e: + print(response.text) + raise e + + +requests.Response.raise_for_status = raise_for_status_logging_body + + def _load_generated_infra(name: str) -> int: infra_path = Path(__file__).parent / f"data/infras/{name}/infra.json" with infra_path.open() as json_infra: