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: