Skip to content

Commit 7e63ebe

Browse files
authored
Add regression test for Enum imported as alias (#6798)
1 parent 0ce5277 commit 7e63ebe

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fixed inference of ``Enums`` when they are imported under an alias.
2+
3+
Closes #5776
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Test for a regression with Enums not being recognized when imported with an alias.
2+
3+
Reported in https://github.com/PyCQA/pylint/issues/5776
4+
"""
5+
6+
from enum import Enum as PyEnum
7+
8+
9+
class MyEnum(PyEnum):
10+
"""My enum"""
11+
12+
ENUM_KEY = "enum_value"
13+
14+
15+
print(MyEnum.ENUM_KEY.value)

0 commit comments

Comments
 (0)