Skip to content

Commit

Permalink
Test/dnf4.mark: make failures to parse dnf output easier to debug
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thozza committed Jul 29, 2024
1 parent a8f3a1e commit 52200c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/run/test_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,12 @@ def test_dnf4_mark(self):
# 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"
Expand Down

0 comments on commit 52200c5

Please sign in to comment.