Skip to content

Commit e8fa99d

Browse files
author
Jean-Louis Fuchs
committed
Expect alternate errors in test_file_surrogates()
Not all file systems trigger a FileNotFoundError when encountering surrogates. Inside Podman, the file system triggers an `OSError: [Errno 84] Illegal byte sequence: '\udcff'`.
1 parent 2d610e3 commit e8fa99d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def no_access(*args, **kwargs):
226226
def test_file_surrogates(type, tmp_path):
227227
path = tmp_path / "\udcff"
228228

229-
with pytest.raises(click.BadParameter, match="�': No such file or directory"):
229+
match = r"(�': No such file or directory|Illegal byte sequence)"
230+
with pytest.raises(click.BadParameter, match=match):
230231
type.convert(path, None, None)
231232

232233

0 commit comments

Comments
 (0)