mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Close issue24840: Enum._value_ is queried for bool(); original patch by Mike Lundy
This commit is contained in:
parent
b1a3d9ae56
commit
6db1fd5fb8
3 changed files with 11 additions and 0 deletions
|
@ -270,6 +270,13 @@ class TestEnum(unittest.TestCase):
|
|||
class Wrong(Enum):
|
||||
_any_name_ = 9
|
||||
|
||||
def test_bool(self):
|
||||
class Logic(Enum):
|
||||
true = True
|
||||
false = False
|
||||
self.assertTrue(Logic.true)
|
||||
self.assertFalse(Logic.false)
|
||||
|
||||
def test_contains(self):
|
||||
Season = self.Season
|
||||
self.assertIn(Season.AUTUMN, Season)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue