Skip to content

Commit 8f52a8c

Browse files
authored
Fix test for python 3.11 (#212)
1 parent 32299c8 commit 8f52a8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_class_schema.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class A:
227227
schema.load({"data": data})
228228

229229
def test_final_infers_type_from_default(self):
230-
# @dataclasses.dataclass
230+
# @dataclasses.dataclass(frozen=True)
231231
class A:
232232
data: Final = "a"
233233

@@ -238,7 +238,8 @@ class B:
238238
# NOTE: This workaround is needed to avoid a Mypy crash.
239239
# See: https://github.com/python/mypy/issues/10090#issuecomment-865971891
240240
if not TYPE_CHECKING:
241-
A = dataclasses.dataclass(A)
241+
frozen_dataclass = dataclasses.dataclass(frozen=True)
242+
A = frozen_dataclass(A)
242243
B = dataclasses.dataclass(B)
243244

244245
with self.assertWarns(Warning):

0 commit comments

Comments
 (0)