summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-02-19 21:28:36 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-02-19 21:28:36 (GMT)
commitf4558e8b54da0a7caf800c80589d934186b16f79 (patch)
treebf699aef6c804f62d3e00f14379804ece47fa50a /Lib/test/test_pydoc.py
parent57d240ef645c4d78432ce722844c150e5ba25fbb (diff)
parent056eb02719497a700e332d2ad69c2b11db0e3552 (diff)
downloadcpython-f4558e8b54da0a7caf800c80589d934186b16f79.zip
cpython-f4558e8b54da0a7caf800c80589d934186b16f79.tar.gz
cpython-f4558e8b54da0a7caf800c80589d934186b16f79.tar.bz2
merge heads
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 105116a..9909b9a 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -386,6 +386,16 @@ class PydocDocTest(unittest.TestCase):
print_diffs(expected_text, result)
self.fail("outputs are not equal, see diff above")
+ def test_text_enum_member_with_value_zero(self):
+ # Test issue #20654 to ensure enum member with value 0 can be
+ # displayed. It used to throw KeyError: 'zero'.
+ import enum
+ class BinaryInteger(enum.IntEnum):
+ zero = 0
+ one = 1
+ doc = pydoc.render_doc(BinaryInteger)
+ self.assertIn('<BinaryInteger.zero: 0>', doc)
+
def test_issue8225(self):
# Test issue8225 to ensure no doc link appears for xml.etree
result, doc_loc = get_pydoc_text(xml.etree)