mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
bpo-38967: Improve the error msg for reserved _sunder_ names in enum (GH-18370)
This commit is contained in:
parent
b48389d950
commit
2ec67526a6
2 changed files with 7 additions and 1 deletions
|
@ -419,6 +419,11 @@ class TestEnum(unittest.TestCase):
|
|||
green = 2
|
||||
blue = 3
|
||||
|
||||
def test_reserved__sunder_(self):
|
||||
with self.assertRaisesRegex(ValueError, '_sunder_ names, such as '
|
||||
'"_bad_", are reserved'):
|
||||
class Bad(Enum):
|
||||
_bad_ = 1
|
||||
|
||||
def test_enum_with_value_name(self):
|
||||
class Huh(Enum):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue