1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 7 Jan 2026 15:05:29 +0000
Subject: Fix test_set_only_work_in_hashable_types on Python 3.14
https://github.com/python/cpython/issues/132825 expanded this error
message.
Forwarded: https://github.com/lovasoa/marshmallow_dataclass/pull/286
Bug-Debian: https://bugs.debian.org/1123265
Last-Update: 2026-01-07
---
tests/test_collection.py | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/tests/test_collection.py b/tests/test_collection.py
index 594e8cb..57a8c3d 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -188,7 +188,13 @@ class TestSetField(unittest.TestCase):
with self.assertRaises(TypeError) as err_info:
schema.load({"value": {set()}})
- self.assertEqual(str(err_info.exception), "unhashable type: 'set'")
+ self.assertIn(
+ str(err_info.exception),
+ {
+ "unhashable type: 'set'",
+ "cannot use 'set' as a set element (unhashable type: 'set')",
+ },
+ )
@dataclass()
class Elm:
@@ -202,7 +208,13 @@ class TestSetField(unittest.TestCase):
with self.assertRaises(TypeError) as err_info:
schema.load({"value": {{"value": {set()}}}})
- self.assertEqual(str(err_info.exception), "unhashable type: 'set'")
+ self.assertIn(
+ str(err_info.exception),
+ {
+ "unhashable type: 'set'",
+ "cannot use 'set' as a set element (unhashable type: 'set')",
+ },
+ )
def test_set_of_frozen_dataclass(self):
@dataclass(frozen=True)
|