Test/dnf4.mark: make failures to parse dnf output easier to debug

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 <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-07-29 10:19:13 +02:00 committed by Tomáš Hozza
parent a8f3a1e834
commit 52200c581d

View file

@ -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"