bpo-38967: Improve the error msg for reserved _sunder_ names in enum (GH-18370)

This commit is contained in:
Zackery Spytz 2020-09-13 14:27:51 -06:00 committed by GitHub
parent b48389d950
commit 2ec67526a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -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):