2424 djpeg_available ,
2525 hopper ,
2626 is_win32 ,
27+ mark_if_feature_version ,
2728 skip_unless_feature ,
2829)
2930
@@ -116,7 +117,9 @@ def test(xdpi, ydpi=None):
116117 assert test (100 , 200 ) == (100 , 200 )
117118 assert test (0 ) is None # square pixels
118119
119- @pytest .mark .valgrind_known_error (reason = "Known Failing" )
120+ @mark_if_feature_version (
121+ pytest .mark .valgrind_known_error , "libjpeg_turbo" , "2.0" , reason = "Known Failing"
122+ )
120123 def test_icc (self , tmp_path ):
121124 # Test ICC support
122125 with Image .open ("Tests/images/rgb.jpg" ) as im1 :
@@ -156,7 +159,9 @@ def test(n):
156159 test (ImageFile .MAXBLOCK + 1 ) # full buffer block plus one byte
157160 test (ImageFile .MAXBLOCK * 4 + 3 ) # large block
158161
159- @pytest .mark .valgrind_known_error (reason = "Known Failing" )
162+ @mark_if_feature_version (
163+ pytest .mark .valgrind_known_error , "libjpeg_turbo" , "2.0" , reason = "Known Failing"
164+ )
160165 def test_large_icc_meta (self , tmp_path ):
161166 # https://github.com/python-pillow/Pillow/issues/148
162167 # Sometimes the meta data on the icc_profile block is bigger than
@@ -423,7 +428,9 @@ def test_ff00_jpeg_header(self):
423428 with Image .open (filename ):
424429 pass
425430
426- @pytest .mark .valgrind_known_error (reason = "Known Failing" )
431+ @mark_if_feature_version (
432+ pytest .mark .valgrind_known_error , "libjpeg_turbo" , "2.0" , reason = "Known Failing"
433+ )
427434 def test_truncated_jpeg_should_read_all_the_data (self ):
428435 filename = "Tests/images/truncated_jpeg.jpg"
429436 ImageFile .LOAD_TRUNCATED_IMAGES = True
@@ -442,7 +449,9 @@ def test_truncated_jpeg_throws_oserror(self):
442449 with pytest .raises (OSError ):
443450 im .load ()
444451
445- @pytest .mark .valgrind_known_error (reason = "Known Failing" )
452+ @mark_if_feature_version (
453+ pytest .mark .valgrind_known_error , "libjpeg_turbo" , "2.0" , reason = "Known Failing"
454+ )
446455 def test_qtables (self , tmp_path ):
447456 def _n_qtables_helper (n , test_file ):
448457 with Image .open (test_file ) as im :
@@ -726,7 +735,9 @@ def test_invalid_exif(self):
726735 # OSError for unidentified image.
727736 assert im .info .get ("dpi" ) == (72 , 72 )
728737
729- @pytest .mark .valgrind_known_error (reason = "Known Failing" )
738+ @mark_if_feature_version (
739+ pytest .mark .valgrind_known_error , "libjpeg_turbo" , "2.0" , reason = "Known Failing"
740+ )
730741 def test_exif_x_resolution (self , tmp_path ):
731742 with Image .open ("Tests/images/flower.jpg" ) as im :
732743 exif = im .getexif ()
@@ -757,7 +768,9 @@ def test_ifd_offset_exif(self):
757768 # Act / Assert
758769 assert im ._getexif ()[306 ] == "2017:03:13 23:03:09"
759770
760- @pytest .mark .valgrind_known_error (reason = "Backtrace in Python Core" )
771+ @mark_if_feature_version (
772+ pytest .mark .valgrind_known_error , "libjpeg_turbo" , "2.0" , reason = "Known Failing"
773+ )
761774 def test_photoshop (self ):
762775 with Image .open ("Tests/images/photoshop-200dpi.jpg" ) as im :
763776 assert im .info ["photoshop" ][0x03ED ] == {
0 commit comments