summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_typing.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2020-12-10 21:49:05 (GMT)
committerGitHub <noreply@github.com>2020-12-10 21:49:05 (GMT)
commit67b769f5157c9dad1c7dd6b24e067b9fdab5b35d (patch)
treef7866a693a7fa42ce88f86d89159ce26c1adc361 /Lib/test/test_typing.py
parenta65828717982e6a56382d7aff738478f5b5b25d0 (diff)
downloadcpython-67b769f5157c9dad1c7dd6b24e067b9fdab5b35d.zip
cpython-67b769f5157c9dad1c7dd6b24e067b9fdab5b35d.tar.gz
cpython-67b769f5157c9dad1c7dd6b24e067b9fdab5b35d.tar.bz2
bpo-42059: Fix required/optional keys for TypedDict(..., total=False) (GH-22736)
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r--Lib/test/test_typing.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 8ffc7f4..f3e38b6 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -3895,10 +3895,14 @@ class TypedDictTests(BaseTestCase):
self.assertEqual(D(), {})
self.assertEqual(D(x=1), {'x': 1})
self.assertEqual(D.__total__, False)
+ self.assertEqual(D.__required_keys__, frozenset())
+ self.assertEqual(D.__optional_keys__, {'x'})
self.assertEqual(Options(), {})
self.assertEqual(Options(log_level=2), {'log_level': 2})
self.assertEqual(Options.__total__, False)
+ self.assertEqual(Options.__required_keys__, frozenset())
+ self.assertEqual(Options.__optional_keys__, {'log_level', 'log_path'})
def test_optional_keys(self):
class Point2Dor3D(Point2D, total=False):