gh-128617: Fix test_typing.test_readonly_inheritance (#128618)

This commit is contained in:
sobolevn 2025-01-08 14:19:41 +03:00 committed by GitHub
parent 474e419792
commit 971a52b549
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8912,13 +8912,13 @@ class TypedDictTests(BaseTestCase):
self.assertEqual(Child1.__mutable_keys__, frozenset({'b'}))
class Base2(TypedDict):
a: ReadOnly[int]
a: int
class Child2(Base2):
b: str
b: ReadOnly[str]
self.assertEqual(Child1.__readonly_keys__, frozenset({'a'}))
self.assertEqual(Child1.__mutable_keys__, frozenset({'b'}))
self.assertEqual(Child2.__readonly_keys__, frozenset({'b'}))
self.assertEqual(Child2.__mutable_keys__, frozenset({'a'}))
def test_cannot_make_mutable_key_readonly(self):
class Base(TypedDict):