Skip to content

Commit 9372fbc

Browse files
sty: Apply ruff preview rule RUF043
RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
1 parent d38f469 commit 9372fbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/tests/test_loadsave.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_load_bad_compressed_extension(tmp_path, extension):
8888
pytest.skip()
8989
file_path = tmp_path / f'img.nii{extension}'
9090
file_path.write_bytes(b'bad')
91-
with pytest.raises(ImageFileError, match='.*is not a .* file'):
91+
with pytest.raises(ImageFileError, match=r'.*is not a .* file'):
9292
load(file_path)
9393

9494

@@ -99,7 +99,7 @@ def test_load_good_extension_with_bad_data(tmp_path, extension):
9999
file_path = tmp_path / f'img.nii{extension}'
100100
with Opener(file_path, 'wb') as fobj:
101101
fobj.write(b'bad')
102-
with pytest.raises(ImageFileError, match='Cannot work out file type of .*'):
102+
with pytest.raises(ImageFileError, match=r'Cannot work out file type of .*'):
103103
load(file_path)
104104

105105

0 commit comments

Comments
 (0)