@@ -169,7 +169,7 @@ def test_write_oversized_block():
169169 data = np .ones (30 , dtype = "uint8" )
170170 raw_fd = io .BytesIO ()
171171 fd = generic_io .get_file (raw_fd , mode = "rw" )
172- with pytest .raises (RuntimeError , match = "Block used size.*" ):
172+ with pytest .raises (RuntimeError , match = r "Block used size.*" ):
173173 bio .write_block (fd , data , allocated_size = 0 )
174174 assert fd .tell () == 0
175175
@@ -190,7 +190,7 @@ def test_fd_not_seekable():
190190
191191 np .testing .assert_array_equal (d , data )
192192
193- with pytest .raises (ValueError , match = "write_block received offset.*" ):
193+ with pytest .raises (ValueError , match = r "write_block received offset.*" ):
194194 bio .write_block (fd , data , offset = 0 )
195195
196196
@@ -223,14 +223,14 @@ def test_read_from_closed(tmp_path):
223223 bio .write_block (fd , data , stream = True )
224224 with generic_io .get_file (fn , mode = "rw" ) as fd :
225225 _ , _ , _ , callback = bio .read_block (fd , offset = 0 , lazy_load = True )
226- with pytest .raises (OSError , match = "ASDF file has already been closed. Can not get the data." ):
226+ with pytest .raises (OSError , match = r "ASDF file has already been closed\ . Can not get the data\ ." ):
227227 callback ()
228228
229229
230230@pytest .mark .parametrize ("data" , [np .ones (10 , dtype = "f4" ), np .ones ((3 , 3 ), dtype = "uint8" )])
231231def test_invalid_data (data ):
232232 fd = generic_io .get_file (io .BytesIO (), mode = "rw" )
233- with pytest .raises (ValueError , match = "Data must be of.*" ):
233+ with pytest .raises (ValueError , match = r "Data must be of.*" ):
234234 bio .write_block (fd , data , stream = True )
235235
236236
@@ -337,7 +337,7 @@ def test_read_block_index_no_header(tmp_path):
337337 generate_block_index_file (fn , values = values , offset = 0 )
338338 with generic_io .get_file (fn , "r" ) as fd :
339339 fd .seek (len (constants .INDEX_HEADER ))
340- with pytest .raises (BlockIndexError , match = "Failed to read block index.*" ):
340+ with pytest .raises (BlockIndexError , match = r "Failed to read block index.*" ):
341341 assert bio .read_block_index (fd ) == values
342342
343343
0 commit comments