Skip to content

Commit dac182d

Browse files
committed
Use UnicodeEncodeError instead of ValueError
1 parent 81ae570 commit dac182d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_lib.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ def test(entry):
3131
try:
3232
pattern = URLPattern(*entry["pattern"])
3333

34-
except ValueError:
35-
pytest.xfail("unsupported regular expression")
34+
except UnicodeEncodeError as e:
35+
if e.reason == "surrogates not allowed":
36+
pytest.xfail(e.reason)
37+
raise
3638

3739
if "expected_obj" in entry:
3840
for key in entry["expected_obj"]:

0 commit comments

Comments
 (0)