diff -r 29b8ec9195ff Lib/test/test_enum.py --- a/Lib/test/test_enum.py Mon Sep 16 04:03:12 2013 +0200 +++ b/Lib/test/test_enum.py Mon Sep 16 12:34:27 2013 +0800 @@ -1033,6 +1033,29 @@ yellow = 6 self.assertEqual(MoreColor.magenta.hex(), '5 hexlified!') + def test_attribute_deletion(self): + class Season(Enum): + SPRING = 1 + SUMMER = 2 + AUTUMN = 3 + WINTER = 4 + + def spam(cls): pass + + self.assertTrue(hasattr(Season, 'spam')) + del Season.spam + self.assertFalse(hasattr(Season, 'spam')) + + with self.assertRaises(AttributeError): + del Season.SPRING + with self.assertRaises(TypeError): + del Season['SPRING'] + with self.assertRaises(AttributeError): + del Season.DRY + with self.assertRaises(TypeError): + del Season['DRY'] + with self.assertRaises(AttributeError): + del Season.SPRING.name def test_no_duplicates(self): class UniqueEnum(Enum):