Skip to content

Commit 9852ee4

Browse files
committed
allow annotations to specified after members on py 3.14+
1 parent 21aa83e commit 9852ee4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/annotations/test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,14 @@ class MyEnum2(EnumProperties):
899899
# should not be interpreted as a property
900900
label: str
901901

902-
with self.assertRaises(AttributeError):
903-
MyEnum2.VALUE1.label
902+
if sys.version_info[:2] < (3, 14):
903+
with self.assertRaises(AttributeError):
904+
MyEnum2.VALUE1.label
905+
else:
906+
# Python 3.14+ supports this use case
907+
self.assertEqual(MyEnum2.VALUE1.label, "label1")
908+
self.assertEqual(MyEnum2.VALUE2.label, "label2")
909+
self.assertEqual(MyEnum2.VALUE3.label, "label3")
904910

905911
class MyEnum3(EnumProperties):
906912
VALUE1 = 0, "label1"

0 commit comments

Comments
 (0)