mirror of
https://github.com/python/cpython.git
synced 2025-11-11 22:55:08 +00:00
gh-128617: Fix test_typing.test_readonly_inheritance (#128618)
This commit is contained in:
parent
474e419792
commit
971a52b549
1 changed files with 4 additions and 4 deletions
|
|
@ -8912,13 +8912,13 @@ class TypedDictTests(BaseTestCase):
|
||||||
self.assertEqual(Child1.__mutable_keys__, frozenset({'b'}))
|
self.assertEqual(Child1.__mutable_keys__, frozenset({'b'}))
|
||||||
|
|
||||||
class Base2(TypedDict):
|
class Base2(TypedDict):
|
||||||
a: ReadOnly[int]
|
a: int
|
||||||
|
|
||||||
class Child2(Base2):
|
class Child2(Base2):
|
||||||
b: str
|
b: ReadOnly[str]
|
||||||
|
|
||||||
self.assertEqual(Child1.__readonly_keys__, frozenset({'a'}))
|
self.assertEqual(Child2.__readonly_keys__, frozenset({'b'}))
|
||||||
self.assertEqual(Child1.__mutable_keys__, frozenset({'b'}))
|
self.assertEqual(Child2.__mutable_keys__, frozenset({'a'}))
|
||||||
|
|
||||||
def test_cannot_make_mutable_key_readonly(self):
|
def test_cannot_make_mutable_key_readonly(self):
|
||||||
class Base(TypedDict):
|
class Base(TypedDict):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue