From b97a995dc4e891370ad55e762afe0b69e2446434 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Sun, 21 Apr 2024 10:03:10 +0200 Subject: [PATCH] Add assert_ok helper --- tests/integration/conftest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 865d440..0ec12b2 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -155,3 +155,8 @@ def posted_status_id(out): _, _, status_id = match.groups() return status_id + + +def assert_ok(result: Result): + if result.exit_code != 0: + raise AssertionError(f"Command failed with exit code {result.exit_code}\nStderr: {result.stderr}")