Skip to content

Commit 7fed2ec

Browse files
author
Guido van Rossum
committed
Test missing Enum attribute
1 parent 63ae048 commit 7fed2ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test-data/unit/check-enum.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ S = Enum('S', {1: 1})
275275
T = Enum('T', keyword='a b')
276276
U = Enum('U', *['a'])
277277
V = Enum('U', **{'a': 1})
278+
W = Enum('W', 'a b')
279+
W.c
278280
[out]
279281
main:2: error: Too few arguments for Enum()
280282
main:3: error: Enum() expects a string, tuple, list or dict literal as the second argument
@@ -295,6 +297,7 @@ main:17: error: Enum() with dict literal requires string literals
295297
main:18: error: Unexpected arguments to Enum()
296298
main:19: error: Unexpected arguments to Enum()
297299
main:20: error: Unexpected arguments to Enum()
300+
main:22: error: "W" has no attribute "c"
298301

299302
[case testFunctionalEnumFlag]
300303
from enum import Flag, IntFlag

0 commit comments

Comments
 (0)