Skip to content

Commit e50b5bb

Browse files
committed
Add regression tests for Enum.name and .value inference
Ref pylint-dev#1932. Ref pylint-dev#2062. Ref pylint-dev/astroid#1020.
1 parent 90d8a90 commit e50b5bb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# pylint: disable=missing-docstring
2+
from enum import Enum, IntEnum
3+
4+
5+
class Issue1932(IntEnum):
6+
"""https://github.com/PyCQA/pylint/issues/1932"""
7+
FOO = 1
8+
9+
def whats_my_name(self):
10+
return self.name.lower()
11+
12+
13+
class Issue2062(Enum):
14+
"""https://github.com/PyCQA/pylint/issues/2062"""
15+
FOO = 1
16+
BAR = 2
17+
18+
def __str__(self):
19+
return self.name.lower()

0 commit comments

Comments
 (0)