Skip to content

Commit b63239d

Browse files
authored
Expect alternate errors in test_file_surrogates() (#2946)
Add test case to cover rootless podman.
2 parents 2d610e3 + 7559bb8 commit b63239d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/test_types.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,12 @@ 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+
# - common case: �': No such file or directory
230+
# - special case: Illegal byte sequence
231+
# The spacial case is seen with rootless Podman. The root cause is most
232+
# likely that the path is handled by a user-space program (FUSE).
233+
match = r"(�': No such file or directory|Illegal byte sequence)"
234+
with pytest.raises(click.BadParameter, match=match):
230235
type.convert(path, None, None)
231236

232237

0 commit comments

Comments
 (0)