diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-11-18 01:52:54 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2010-11-18 01:52:54 (GMT) |
commit | a47bbf5a4b6aaba52be774ddd2cb23be26a638ef (patch) | |
tree | de599d78aab41cbbcd75083d2581a2aea39fb527 /Lib/test/test_pydoc.py | |
parent | f609654b0e36796275b7c9f822349e89fe9b4f2d (diff) | |
download | cpython-a47bbf5a4b6aaba52be774ddd2cb23be26a638ef.zip cpython-a47bbf5a4b6aaba52be774ddd2cb23be26a638ef.tar.gz cpython-a47bbf5a4b6aaba52be774ddd2cb23be26a638ef.tar.bz2 |
Issue #10446: Several changes to module documentation generated by pydoc:
1. Online reference manual link is now version-specific and the
'MODULE DOCS' section renamed to 'MODULE REFERENCE'.
2. 'FILE' section is moved to the end of the file.
3. Special names processed by pydoc such as __version__ or __credits__
are now excluded from the DATA section.
4. Defined __all__ to prevent pydoc from exposing undocumented details
about itself.
5. Removed Python 2.3 compatibility code.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 603755a..af28348 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -22,9 +22,6 @@ if hasattr(pydoc_mod, "__loader__"): expected_text_pattern = """ NAME test.pydoc_mod - This is a test module for test_pydoc - -FILE - %s %s CLASSES builtins.object @@ -72,9 +69,7 @@ FUNCTIONS nodoc_func() DATA - __author__ = 'Benjamin Peterson' - __credits__ = 'Nobody' - __version__ = '1.2.3.4' + __xyz__ = 'X, Y and Z' VERSION 1.2.3.4 @@ -84,6 +79,9 @@ AUTHOR CREDITS Nobody + +FILE + %s """.strip() expected_html_pattern = """ @@ -167,9 +165,7 @@ war</tt></dd></dl> <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> \x20\x20\x20\x20 <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> -<td width="100%%"><strong>__author__</strong> = 'Benjamin Peterson'<br> -<strong>__credits__</strong> = 'Nobody'<br> -<strong>__version__</strong> = '1.2.3.4'</td></tr></table><p> +<td width="100%%"><strong>__xyz__</strong> = 'X, Y and Z'</td></tr></table><p> <table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#7799ee"> <td colspan=3 valign=bottom> <br> @@ -259,7 +255,7 @@ class PyDocDocTest(unittest.TestCase): def test_text_doc(self): result, doc_loc = get_pydoc_text(pydoc_mod) expected_text = expected_text_pattern % \ - (inspect.getabsfile(pydoc_mod), doc_loc) + (doc_loc, inspect.getabsfile(pydoc_mod)) if result != expected_text: print_diffs(expected_text, result) self.fail("outputs are not equal, see diff above") |