[Git][reproducible-builds/diffoscope][master] 2 commits: Factor out Python version checking in test_zip.py. (Re: #362)

Chris Lamb (@lamby) gitlab at salsa.debian.org
Mon Mar 25 09:01:28 UTC 2024



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
71019a8d by Chris Lamb at 2024-03-25T08:59:28+00:00
Factor out Python version checking in test_zip.py. (Re: #362)

- - - - -
f8270ba8 by Chris Lamb at 2024-03-25T09:00:29+00:00
Also skip some zip tests under 3.10.14 as well; a potential regression may have been backported to the 3.10.x series. (Re: #362)

- - - - -


1 changed file:

- tests/comparators/test_zip.py


Changes:

=====================================
tests/comparators/test_zip.py
=====================================
@@ -39,6 +39,12 @@ jmod2 = load_fixture("test2.jmod")
 test_comment1 = load_fixture("test_comment1.zip")
 test_comment2 = load_fixture("test_comment2.zip")
 
+# See #362
+skip_if_python_zip_regression = pytest.mark.skipif(
+    sys.version_info >= (3, 10, 14),
+    reason="Test fails under 3.10.14+ (and 3.11.8+); possible regression",
+)
+
 
 def test_identification(zip1):
     assert isinstance(zip1, ZipFile)
@@ -85,10 +91,7 @@ def test_mozzip_identification(mozzip1):
     assert isinstance(mozzip1, MozillaZipFile)
 
 
- at skipif(
-    sys.version_info >= (3, 11, 8),
-    reason="Test fails under 3.11.8+; possible regression",
-)
+ at skip_if_python_zip_regression
 def test_mozzip_no_differences(mozzip1):
     difference = mozzip1.compare(mozzip1)
     assert difference is None
@@ -100,19 +103,13 @@ def mozzip_differences(mozzip1, mozzip2):
 
 
 @skip_unless_tools_exist("zipinfo")
- at skipif(
-    sys.version_info >= (3, 11, 8),
-    reason="Test fails under 3.11.8+; possible regression",
-)
+ at skip_if_python_zip_regression
 def test_mozzip_metadata(mozzip_differences, mozzip1, mozzip2):
     assert_diff(mozzip_differences[0], "mozzip_zipinfo_expected_diff")
 
 
 @skip_unless_tools_exist("zipinfo")
- at skipif(
-    sys.version_info >= (3, 11, 8),
-    reason="Test fails under 3.11.8+; possible regression",
-)
+ at skip_if_python_zip_regression
 def test_mozzip_compressed_files(mozzip_differences):
     assert mozzip_differences[-1].source1 == "dir/text"
     assert mozzip_differences[-1].source2 == "dir/text"
@@ -120,10 +117,7 @@ def test_mozzip_compressed_files(mozzip_differences):
 
 
 @skip_unless_tools_exist("zipinfo")
- at skipif(
-    sys.version_info >= (3, 11, 8),
-    reason="Test fails under 3.11.8+; possible regression",
-)
+ at skip_if_python_zip_regression
 def test_mozzip_compare_non_existing(monkeypatch, mozzip1):
     assert_non_existing(monkeypatch, mozzip1)
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e1227e4ab37eef63fee60d60d13ccd56ef021d1d...f8270ba86425967c013035388b3c327c4116b8e5

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e1227e4ab37eef63fee60d60d13ccd56ef021d1d...f8270ba86425967c013035388b3c327c4116b8e5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20240325/7779eb99/attachment.htm>


More information about the rb-commits mailing list