test_content_source_verbose fails with xz 5.2.8 on guix
When trying to update to diffoscope 267 on guix, an xz test failed:
tests/comparators/test_xz.py::test_content_source_verbose FAILED
=================================== FAILURES ===================================
_________________________ test_content_source_verbose __________________________
differences_verbose = [<Difference xz --list -- xz --list []>]
@skip_unless_tools_exist("xz")
def test_content_source_verbose(differences_verbose):
assert differences_verbose[0].source1 == "xz --list"
assert differences_verbose[0].source2 == "xz --list"
> assert_diff(differences_verbose[0], "text_xz_list")
tests/comparators/test_xz.py:89:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
difference = <Difference xz --list -- xz --list []>, filename = 'text_xz_list'
def assert_diff(difference, filename):
# Assign seen and expected values to local variables to improve contextual
# information in failed tests.
seen = difference.unified_diff
expected = get_data(filename)
> assert seen == expected
E AssertionError
Using xz 5.4.5 worked around the problem, but it will be a while before that version can land in guix.
Seems like the test should have a versioned dependency at the very least, somewhere between 5.2.8 and 5.4.5, and/or test data added for older versions.
I did try manually run diffoscope on the output, and I could not catch the difference with my eyeball, although the output was prettified a bit even with the --text output method, so I could not compare directly against the test data provided.
How is the test data normally generated? This is edging into an aside, but could diffoscope have a flag to output in a test-data compatible format?