test fails with file 5.40
I see some test fails with file 5.40 as opposed to 5.39. I had a closer look at test_guess_file_type
which uses tests/data/binary1
> file tests/data/binary1
tests/data/binary1: OpenPGP Public Key
> file --version
file-5.40
Using the older version:
> file --version
file-5.39
> file diffoscope-173/tests/data/binary1
diffoscope-173/tests/data/binary1: data
These are all the errors that I see which I assume are related to this (all looking "similar"):
[ 33s] _______________________________ test_difference ________________________________
[ 33s]
[ 33s] differences = [<Difference filetype from file(1) -- filetype from file(1) []>, <Difference filetype from diffoscope -- filetype from...ent -- r/r.zip []>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]>]
[ 33s]
[ 33s] @skip_unless_file_version_is_at_least("5.37")
[ 33s] def test_difference(differences):
[ 33s] expected_diff = get_data("quine_expected_diff")
[ 33s] > assert differences[0].unified_diff == expected_diff
[ 33s] E AssertionError: assert '@@ -1 +1 @@\...hod=deflate\n' == '@@ -1 +1 @@\... to extract\n'
[ 33s] E Skipping 124 identical leading characters in diff, use -v to show
[ 33s] E - to extract
[ 33s] E + to extract, compression method=deflate
[ 33s]
[ 33s] tests/test_quines.py:57: AssertionError
[ 33s] _____________________________ test_guess_file_type _____________________________
[ 33s]
[ 33s] def test_guess_file_type():
[ 33s] > assert File.guess_file_type(TEST_FILE1_PATH) == "data"
[ 33s] E AssertionError: assert 'OpenPGP Public Key' == 'data'
[ 33s] E - data
[ 33s] E + OpenPGP Public Key
[ 33s]
[ 33s] tests/comparators/test_binary.py:59: AssertionError
[ 33s] __________________________________ test_equal __________________________________
[ 33s]
[ 33s] set1 = {'bzip2': <<class 'abc.Bzip2File'> /home/abuild/rpmbuild/BUILD/diffoscope-173/tests/data/containers/a.tar.bz2>, 'gzip'...ners/a.tar.gz>, 'xz': <<class 'abc.XzFile'> /home/abuild/rpmbuild/BUILD/diffoscope-173/tests/data/containers/a.tar.xz>}
[ 33s]
[ 33s] @skip_unless_tools_exist("xz")
[ 33s] @skip_unless_file_version_is_at_least("5.37")
[ 33s] def test_equal(set1):
[ 33s] for x, y in itertools.product(TYPES, TYPES):
[ 33s] diff = set1[x].compare(set1[y])
[ 33s] if x == y:
[ 33s] assert diff is None
[ 33s] else:
[ 33s] differences = diff.details
[ 33s] > assert differences[0].unified_diff == expected_magic_diff(
[ 33s] x, y
[ 33s] ), "{} {}".format(x, y)
[ 33s] E AssertionError: gzip xz
[ 33s] E assert '@@ -1 +1 @@\...cksum CRC64\n' == '@@ -1 +1 @@\...ressed data\n'
[ 33s] E Skipping 95 identical leading characters in diff, use -v to show
[ 33s] E - essed data
[ 33s] E + essed data, checksum CRC64
[ 33s]
[ 33s] tests/comparators/test_containers.py:77: AssertionError
[ 33s] ________________________________ test_different ________________________________
[ 33s]
[ 33s] set1 = {'bzip2': <<class 'abc.Bzip2File'> /home/abuild/rpmbuild/BUILD/diffoscope-173/tests/data/containers/a.tar.bz2>, 'gzip'...ners/a.tar.gz>, 'xz': <<class 'abc.XzFile'> /home/abuild/rpmbuild/BUILD/diffoscope-173/tests/data/containers/a.tar.xz>}
[ 33s] set2 = {'bzip2': <<class 'abc.Bzip2File'> /home/abuild/rpmbuild/BUILD/diffoscope-173/tests/data/containers/b.tar.bz2>, 'gzip'...ners/b.tar.gz>, 'xz': <<class 'abc.XzFile'> /home/abuild/rpmbuild/BUILD/diffoscope-173/tests/data/containers/b.tar.xz>}
[ 33s]
[ 33s] @skip_unless_tools_exist("xz")
[ 33s] @skip_unless_file_version_is_at_least("5.37")
[ 33s] def test_different(set1, set2):
[ 33s] for x, y in itertools.product(TYPES, TYPES):
[ 33s] expected_diff = get_data("containers/different_files_expected_diff")
[ 33s] differences = set1[x].compare(set2[y]).details
[ 33s] if x == y:
[ 33s] assert differences[0].details[1].unified_diff == expected_diff
[ 33s] else:
[ 33s] > assert differences[0].unified_diff == expected_magic_diff(
[ 33s] x, y
[ 33s] ), "{} {}".format(x, y)
[ 33s] E AssertionError: gzip xz
[ 33s] E assert '@@ -1 +1 @@\...cksum CRC64\n' == '@@ -1 +1 @@\...ressed data\n'
[ 33s] E Skipping 95 identical leading characters in diff, use -v to show
[ 33s] E - essed data
[ 33s] E + essed data, checksum CRC64
[ 33s]
[ 33s] tests/comparators/test_containers.py:95: AssertionError
Do you see something similar? (I'm using openSUSE Tumbleweed here, not Debian, so issues could lie elsewhere as well)