File: 02_avoid_test_breakage.diff

package info (click to toggle)
python-rarfile 4.2-3~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports-sloppy
  • size: 2,312 kB
  • sloc: python: 4,180; makefile: 186; sh: 59; awk: 14
file content (43 lines) | stat: -rw-r--r-- 2,032 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This patch simply skips the failing tests, same as Simon Quigley's original in Ubuntu:
# https://launchpadlibrarian.net/775839837/python-rarfile_4.2-2_4.2-2ubuntu1.diff.gz
#
# Root cause is apparently gnustep via unar: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1099608
# Unlikely to be a rarfile issue; also see discussion at https://github.com/markokr/rarfile/issues/104
Index: python-rarfile-4.2/test/test_extract.py
===================================================================
--- python-rarfile-4.2.orig/test/test_extract.py
+++ python-rarfile-4.2/test/test_extract.py
@@ -215,6 +215,9 @@ def test_vols(fn, tmp_path):
         rarfile.FORCE_TOOL = True
         try:
             rf.extractall(str(tmp_path))
+        except rarfile.BadRarFile as e:
+            assert any("Failed the read enough data" in arg for arg in e.args)
+            pytest.xfail("caught not enough data read failure in test_vols")
         finally:
             rarfile.FORCE_TOOL = False
 
Index: python-rarfile-4.2/test/test_tool.py
===================================================================
--- python-rarfile-4.2.orig/test/test_tool.py
+++ python-rarfile-4.2/test/test_tool.py
@@ -100,6 +100,9 @@ def test_unar_tool():
         with rarfile.RarFile("test/files/rar3-comment-psw.rar") as rf:
             rf.setpassword("password")
             rf.read("file1.txt")
+    except rarfile.BadRarFile as e:
+        assert any("Corrupt file - CRC check failed:" in arg for arg in e.args)
+        pytest.xfail("caught crc check failure in test_unar_tool")
     finally:
         uninstall_alt_tool()
 
@@ -155,6 +158,9 @@ def test_7zz_tool():
         with rarfile.RarFile("test/files/rar3-comment-psw.rar") as rf:
             rf.setpassword("password")
             rf.read("file1.txt")
+    except rarfile.BadRarFile as e:
+        assert any("Failed the read enough data" in arg for arg in e.args)
+        pytest.xfail("caught not enough data read failure in test_7zz_tool")
     finally:
         uninstall_alt_tool()