summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dataclasses.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_dataclasses.py')
-rw-r--r--Lib/test/test_dataclasses.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index 637c456..01e6684 100644
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -257,6 +257,14 @@ class TestCase(unittest.TestCase):
c = C('foo')
self.assertEqual(c.object, 'foo')
+ def test_field_named_BUILTINS_frozen(self):
+ # gh-96151
+ @dataclass(frozen=True)
+ class C:
+ BUILTINS: int
+ c = C(5)
+ self.assertEqual(c.BUILTINS, 5)
+
def test_field_named_like_builtin(self):
# Attribute names can shadow built-in names
# since code generation is used.