diff options
author | Charles-François Natali <cf.natali@gmail.com> | 2014-06-19 21:45:09 (GMT) |
---|---|---|
committer | Charles-François Natali <cf.natali@gmail.com> | 2014-06-19 21:45:09 (GMT) |
commit | e4cda6ce21dc268e308f0ee95e097f667f680d43 (patch) | |
tree | 083b7fbe6e01e752a0c367729b513e9dcc5c9bfd /Lib/test/test_pydoc.py | |
parent | cee4f034385902659ec1ade666e17537eb2bc399 (diff) | |
parent | 077c9564b7f0c09352d1d918f38d2cb75fe61881 (diff) | |
download | cpython-e4cda6ce21dc268e308f0ee95e097f667f680d43.zip cpython-e4cda6ce21dc268e308f0ee95e097f667f680d43.tar.gz cpython-e4cda6ce21dc268e308f0ee95e097f667f680d43.tar.bz2 |
Merge.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 5c62f68..763c319 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -38,6 +38,7 @@ FILE CLASSES __builtin__.object B + C A \x20\x20\x20\x20 class A @@ -59,6 +60,26 @@ CLASSES | Data and other attributes defined here: |\x20\x20 | NO_MEANING = 'eggs' +\x20\x20\x20\x20 + class C(__builtin__.object) + | Methods defined here: + |\x20\x20 + | get_answer(self) + | Return say_no() + |\x20\x20 + | is_it_true(self) + | Return self.get_answer() + |\x20\x20 + | say_no(self) + |\x20\x20 + | ---------------------------------------------------------------------- + | Data descriptors defined here: + |\x20\x20 + | __dict__ + | dictionary for instance variables (if defined) + |\x20\x20 + | __weakref__ + | list of weak references to the object (if defined) FUNCTIONS doc_func() @@ -108,6 +129,7 @@ expected_html_pattern = \ </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#B">B</a> +</font></dt><dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#C">C</a> </font></dt></dl> </dd> <dt><font face="helvetica, arial"><a href="test.pydoc_mod.html#A">A</a> @@ -142,6 +164,28 @@ expected_html_pattern = \ Data and other attributes defined here:<br> <dl><dt><strong>NO_MEANING</strong> = 'eggs'</dl> +</td></tr></table> <p> +<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section"> +<tr bgcolor="#ffc8d8"> +<td colspan=3 valign=bottom> <br> +<font color="#000000" face="helvetica, arial"><a name="C">class <strong>C</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> +\x20\x20\x20\x20 +<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> +<td width="100%%">Methods defined here:<br> +<dl><dt><a name="C-get_answer"><strong>get_answer</strong></a>(self)</dt><dd><tt>Return <a href="#C-say_no">say_no</a>()</tt></dd></dl> + +<dl><dt><a name="C-is_it_true"><strong>is_it_true</strong></a>(self)</dt><dd><tt>Return self.<a href="#C-get_answer">get_answer</a>()</tt></dd></dl> + +<dl><dt><a name="C-say_no"><strong>say_no</strong></a>(self)</dt></dl> + +<hr> +Data descriptors defined here:<br> +<dl><dt><strong>__dict__</strong></dt> +<dd><tt>dictionary for instance variables (if defined)</tt></dd> +</dl> +<dl><dt><strong>__weakref__</strong></dt> +<dd><tt>list of weak references to the object (if defined)</tt></dd> +</dl> </td></tr></table></td></tr></table><p> <table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> @@ -289,6 +333,14 @@ class PydocDocTest(unittest.TestCase): result, doc_loc = get_pydoc_text(xml.etree) self.assertEqual(doc_loc, "", "MODULE DOCS incorrectly includes a link") + def test_getpager_with_stdin_none(self): + previous_stdin = sys.stdin + try: + sys.stdin = None + pydoc.getpager() # Shouldn't fail. + finally: + sys.stdin = previous_stdin + def test_non_str_name(self): # issue14638 # Treat illegal (non-str) name like no name |