diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2014-10-14 15:58:32 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2014-10-14 15:58:32 (GMT) |
commit | 0ae550bdde7cc87defb89dd19c912bf4485619f5 (patch) | |
tree | 638b4189cb1801788c1183c3903423b93cccc9a3 /Lib/test/test_enum.py | |
parent | 39892055cdd560c9ddb895bfd2b82c3c31329218 (diff) | |
download | cpython-0ae550bdde7cc87defb89dd19c912bf4485619f5.zip cpython-0ae550bdde7cc87defb89dd19c912bf4485619f5.tar.gz cpython-0ae550bdde7cc87defb89dd19c912bf4485619f5.tar.bz2 |
Issue22506: added methods on base Enum class now show up in dir of Enum subclass (3.4)
Diffstat (limited to 'Lib/test/test_enum.py')
-rw-r--r-- | Lib/test/test_enum.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index f1f8063..dccaa4f 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -176,6 +176,18 @@ class TestEnum(unittest.TestCase): set(['__class__', '__doc__', '__module__', 'name', 'value', 'wowser']), ) + def test_dir_on_sub_with_behavior_on_super(self): + # see issue22506 + class SuperEnum(Enum): + def invisible(self): + return "did you see me?" + class SubEnum(SuperEnum): + sample = 5 + self.assertEqual( + set(dir(SubEnum.sample)), + set(['__class__', '__doc__', '__module__', 'name', 'value', 'invisible']), + ) + def test_enum_in_enum_out(self): Season = self.Season self.assertIs(Season(Season.WINTER), Season.WINTER) |