@@ -194,7 +194,7 @@ def test_ascii85decode_five_zero_bytes():
194194def test_ccitparameters ():
195195 with pytest .raises (
196196 DeprecationError ,
197- match = "CCITParameters is deprecated and was removed in pypdf 6.0.0 . Use CCITTParameters instead" ,
197+ match = r "CCITParameters is deprecated and was removed in pypdf 6\.0\.0\ . Use CCITTParameters instead" ,
198198 ):
199199 CCITParameters ()
200200
@@ -382,7 +382,7 @@ def test_iss1787():
382382 obj = data .indirect_reference .get_object ()
383383 obj ["/DecodeParms" ][NameObject ("/Columns" )] = NumberObject (1000 )
384384 obj .decoded_self = None
385- with pytest .raises (expected_exception = PdfReadError , match = "^Unsupported PNG filter 244$" ):
385+ with pytest .raises (expected_exception = PdfReadError , match = r "^Unsupported PNG filter 244$" ):
386386 _ = reader .pages [0 ].images [0 ]
387387
388388
@@ -712,7 +712,7 @@ def test_flate_decode__not_rectangular(caplog):
712712
713713def test_jbig2decode__binary_errors ():
714714 with mock .patch ("pypdf.filters.JBIG2DEC_BINARY" , None ), \
715- pytest .raises (DependencyError , match = "jbig2dec binary is not available." ):
715+ pytest .raises (DependencyError , match = r "jbig2dec binary is not available\ ." ):
716716 JBIG2Decode .decode (b"dummy" )
717717
718718 result = subprocess .CompletedProcess (
@@ -725,7 +725,7 @@ def test_jbig2decode__binary_errors():
725725 )
726726 with mock .patch ("pypdf.filters.subprocess.run" , return_value = result ), \
727727 mock .patch ("pypdf.filters.JBIG2DEC_BINARY" , "/usr/bin/jbig2dec" ), \
728- pytest .raises (DependencyError , match = "jbig2dec>=0.15 is required." ):
728+ pytest .raises (DependencyError , match = r "jbig2dec>=0.15 is required\ ." ):
729729 JBIG2Decode .decode (b"dummy" )
730730
731731
@@ -785,7 +785,7 @@ def test_jbig2decode__edge_cases(caplog):
785785 caplog .clear ()
786786
787787 # Invalid input.
788- with pytest .raises (PdfStreamError , match = "Unable to decode JBIG2 data. Exit code: 1" ):
788+ with pytest .raises (PdfStreamError , match = r "Unable to decode JBIG2 data\ . Exit code: 1" ):
789789 JBIG2Decode .decode (b"aaaaaa" )
790790 assert caplog .messages == [
791791 "jbig2dec FATAL ERROR page has no image, cannot be completed" ,
0 commit comments