]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-128617: Fix `test_typing.test_readonly_inheritance` (GH-128618) (#128622)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 8 Jan 2025 11:43:16 +0000 (12:43 +0100)
committerGitHub <noreply@github.com>
Wed, 8 Jan 2025 11:43:16 +0000 (11:43 +0000)
gh-128617: Fix `test_typing.test_readonly_inheritance` (GH-128618)
(cherry picked from commit 971a52b5495e3d596e599faa1f31d4671897026d)

Co-authored-by: sobolevn <mail@sobolevn.me>
Lib/test/test_typing.py

index 6375d359e72ac8eb8565ad9c5dcd70068fcd4f38..f32bb31280a8efa8d2126a7863712a566ced2b86 100644 (file)
@@ -8829,13 +8829,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):