From 52200c581dcb88bcf0d496b920e55fbcd5bc01c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Mon, 29 Jul 2024 10:19:13 +0200 Subject: [PATCH] Test/dnf4.mark: make failures to parse dnf output easier to debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test case still fails on RHEL-10.0 Beta, even when not using dnf5, with: ``` for line in r.stdout.splitlines(): > package, mark = line.strip().split(",") E ValueError: not enough values to unpack (expected 2, got 1) ``` Make debugging of failures like this easier by printing the line when the issue happens. Signed-off-by: Tomáš Hozza --- test/run/test_stages.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/run/test_stages.py b/test/run/test_stages.py index 476be949..dc91bf8f 100644 --- a/test/run/test_stages.py +++ b/test/run/test_stages.py @@ -557,7 +557,12 @@ class TestStages(test.TestBase): # Upstream bug https://github.com/rpm-software-management/dnf5/issues/709 if not line: continue - package, mark = line.strip().split(",") + + try: + package, mark = line.strip().split(",") + except ValueError: + print(f"Failed to parse line: {line}") + raise if package == "dnf": assert mark == "user"