diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 89a32c7a1a0d14..9d499319662873 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -8356,6 +8356,22 @@ class TD2(TD1): self.assertIs(TD2.__total__, True) + def test_total_with_assigned_value(self): + class TD(TypedDict): + __total__ = "some_value" + + self.assertIs(TD.__total__, True) + + class TD2(TypedDict, total=True): + __total__ = "some_value" + + self.assertIs(TD2.__total__, True) + + class TD3(TypedDict, total=False): + __total__ = "some value" + + self.assertIs(TD3.__total__, False) + def test_optional_keys(self): class Point2Dor3D(Point2D, total=False): z: int