Skip to content

Commit 0aa4867

Browse files
committed
added test case
1 parent 02d1264 commit 0aa4867

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test-data/unit/check-enum.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,6 +2550,20 @@ class Pet(Enum):
25502550
# E: Incompatible types in assignment (expression has type "ellipsis", variable has type "str")
25512551
[builtins fixtures/enum.pyi]
25522552

2553+
[case testEnumMemberFuzzyMatch]
2554+
from enum import Enum
2555+
2556+
class Color(Enum):
2557+
GREEN = 1
2558+
RED = 2
2559+
YELLOW = 3
2560+
2561+
Color.GREN # E: "type[Color]" has no attribute "GREN"; maybe "GREEN"?
2562+
Color.YELOW # E: "type[Color]" has no attribute "YELOW"; maybe "YELLOW"?
2563+
Color.RDE # E: "type[Color]" has no attribute "RDE"
2564+
Color.BLUE # E: "type[Color]" has no attribute "BLUE"
2565+
[builtins fixtures/enum.pyi]
2566+
25532567
[case testEnumValueWithPlaceholderNodeType]
25542568
# https://github.com/python/mypy/issues/11971
25552569
from enum import Enum

0 commit comments

Comments
 (0)