Skip to content

Commit 1601dab

Browse files
authored
Fix test_set_only_work_in_hashable_types on Python 3.14 (#286)
python/cpython#132825 expanded this error message.
1 parent cc96758 commit 1601dab

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

tests/test_collection.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,13 @@ class SetIntSet:
188188

189189
with self.assertRaises(TypeError) as err_info:
190190
schema.load({"value": {set()}})
191-
self.assertEqual(str(err_info.exception), "unhashable type: 'set'")
191+
self.assertIn(
192+
str(err_info.exception),
193+
{
194+
"unhashable type: 'set'",
195+
"cannot use 'set' as a set element (unhashable type: 'set')",
196+
},
197+
)
192198

193199
@dataclass()
194200
class Elm:
@@ -202,7 +208,13 @@ class SetOfDataclass:
202208

203209
with self.assertRaises(TypeError) as err_info:
204210
schema.load({"value": {{"value": {set()}}}})
205-
self.assertEqual(str(err_info.exception), "unhashable type: 'set'")
211+
self.assertIn(
212+
str(err_info.exception),
213+
{
214+
"unhashable type: 'set'",
215+
"cannot use 'set' as a set element (unhashable type: 'set')",
216+
},
217+
)
206218

207219
def test_set_of_frozen_dataclass(self):
208220
@dataclass(frozen=True)

0 commit comments

Comments
 (0)