Skip to content

Commit 63ae048

Browse files
author
Guido van Rossum
committed
Test errors for unexpected arg kinds
1 parent 7b0d959 commit 63ae048

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test-data/unit/check-enum.test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ P = Enum('P', [42])
272272
Q = Enum('Q', [('a', 42, 0)])
273273
R = IntEnum('R', [[0, 42]])
274274
S = Enum('S', {1: 1})
275+
T = Enum('T', keyword='a b')
276+
U = Enum('U', *['a'])
277+
V = Enum('U', **{'a': 1})
275278
[out]
276279
main:2: error: Too few arguments for Enum()
277280
main:3: error: Enum() expects a string, tuple, list or dict literal as the second argument
@@ -289,6 +292,9 @@ main:14: error: Enum() with tuple or list expects strings or (name, value) pairs
289292
main:15: error: Enum() with tuple or list expects strings or (name, value) pairs
290293
main:16: error: IntEnum() with tuple or list expects strings or (name, value) pairs
291294
main:17: error: Enum() with dict literal requires string literals
295+
main:18: error: Unexpected arguments to Enum()
296+
main:19: error: Unexpected arguments to Enum()
297+
main:20: error: Unexpected arguments to Enum()
292298

293299
[case testFunctionalEnumFlag]
294300
from enum import Flag, IntFlag

0 commit comments

Comments
 (0)