Skip to content

Commit 704c735

Browse files
committed
test: test_registry_remove_bad fix for PyPy
1 parent fd27499 commit 704c735

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

tests/runtime/test_resolvers.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from __future__ import annotations
99

10+
import platform
1011
import sys
1112
import textwrap
1213
from io import StringIO
@@ -193,8 +194,9 @@ def test_registry_remove_bad(self, thing: Any) -> None:
193194
try:
194195
_ = hash(thing)
195196
except TypeError:
196-
with pytest.raises(TypeError, match=r"unhashable type: '.+?'"):
197-
parser.resolvers.remove(thing)
198-
else:
199-
# set.discard(nonexistent_element) never raises
200-
parser.resolvers.remove(thing)
197+
if platform.python_implementation() == "CPython":
198+
with pytest.raises(TypeError, match=r"unhashable type|Cannot hash a .* value"):
199+
parser.resolvers.remove(thing)
200+
return
201+
# set.discard(nonexistent_element) never raises
202+
parser.resolvers.remove(thing)

0 commit comments

Comments
 (0)