[Epydoc-commits] SF.net SVN: epydoc: [1496] trunk/epydoc/src/epydoc/test
Brought to you by:
edloper
From: <ed...@us...> - 2007-02-14 03:51:28
|
Revision: 1496 http://svn.sourceforge.net/epydoc/?rev=1496&view=rev Author: edloper Date: 2007-02-13 19:51:27 -0800 (Tue, 13 Feb 2007) Log Message: ----------- - Register a logger, to print any warnings or errors - Added a test case for SF bug #1653486 to docbuilder.doctest - Modified 'specifying constructor signature in class docstring' examples to eliminate warnings (eg duplicate @type for param) Modified Paths: -------------- trunk/epydoc/src/epydoc/test/apidoc.doctest trunk/epydoc/src/epydoc/test/docbuilder.doctest trunk/epydoc/src/epydoc/test/docintrospecter.doctest trunk/epydoc/src/epydoc/test/docparser.doctest trunk/epydoc/src/epydoc/test/encoding.doctest trunk/epydoc/src/epydoc/test/epytext.doctest trunk/epydoc/src/epydoc/test/javadoc.doctest trunk/epydoc/src/epydoc/test/plaintext.doctest trunk/epydoc/src/epydoc/test/pyval_repr.doctest trunk/epydoc/src/epydoc/test/restructuredtext.doctest Modified: trunk/epydoc/src/epydoc/test/apidoc.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/apidoc.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/apidoc.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -9,6 +9,9 @@ >>> from epydoc.apidoc import * + >>> from epydoc.test.util import print_warnings + >>> print_warnings() + Unknown Value ============= Epydoc defines a special object, epydoc.apidoc.UNKNOWN, which is used Modified: trunk/epydoc/src/epydoc/test/docbuilder.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docbuilder.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/docbuilder.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -14,6 +14,9 @@ >>> from epydoc.test.util import runbuilder + >>> from epydoc.test.util import print_warnings + >>> print_warnings() + Docformat selection =================== @@ -72,11 +75,7 @@ ... @type a: date ... """ ... def __init__(self, a): - ... """The ctor docstring. - ... - ... @type a: str - ... """ - ... pass + ... """The ctor docstring.""" ... ''', ... build="Foo", ... attribs="variables name value " @@ -106,10 +105,7 @@ ... @type a: str ... """ ... def __init__(self, **kwargs): - ... """The ctor docstring. - ... - ... @type a: str - ... """ + ... """The ctor docstring.""" ... ''', ... build="Foo", ... attribs="variables name value " @@ -135,7 +131,7 @@ ... @param a: a param. ... @type a: str ... """ - ... def __init__(self): + ... def __init__(self, a): ... pass ... ''', ... build="Foo", @@ -150,7 +146,7 @@ +- arg_descrs = [([u'a'], ... +- arg_types = {u'a': ... +- kwarg = None - +- posargs = ['self'] + +- posargs = ['self', 'a'] +- vararg = None Exceptions can be put in the docstring class, and they are assigned to the @@ -336,3 +332,30 @@ h -99 u'??' i 0 u'[Foo(), 1, 2]' j 0 u'[<epydoc_test.Foo instance at ...>, 1, 2, 3]' + +Merging is_imported +=================== +When we do both parsing & introspection, and merge the result, we +should trust the introspected APIDoc's is_imported value more than the +parsed APIDoc. In particular, in the following example, `x` should +have `is_imported=True`. But if we can't tell from introspection, +then use parse info -- so `y` should be imported, but `z` should not. + + >>> import epydoc.docintrospecter + >>> epydoc.docintrospecter.clear_cache() + >>> runbuilder(s=''' + ... import cStringIO + ... from re import MULTILINE as y + ... x = cStringIO + ... z = y + ... ''', attribs=("variables is_imported ")) + ModuleDoc for epydoc_test [0] + +- variables + +- cStringIO => VariableDoc for epydoc_test.cStringIO [1] + | +- is_imported = True + +- x => VariableDoc for epydoc_test.x [2] + | +- is_imported = True + +- y => VariableDoc for epydoc_test.y [3] + | +- is_imported = True + +- z => VariableDoc for epydoc_test.z [4] + +- is_imported = False Modified: trunk/epydoc/src/epydoc/test/docintrospecter.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docintrospecter.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/docintrospecter.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -17,6 +17,9 @@ >>> from epydoc.test.util import runintrospecter + >>> from epydoc.test.util import print_warnings + >>> print_warnings() + Module Variables ================ Each variable defined by a module is encoded as a `VariableDoc`, whose Modified: trunk/epydoc/src/epydoc/test/docparser.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docparser.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/docparser.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -17,6 +17,9 @@ >>> from epydoc.test.util import runparser + >>> from epydoc.test.util import print_warnings + >>> print_warnings() + Module Variables from Assignment Statements =========================================== Variables are extracted from any assignment statements in the module, @@ -390,6 +393,7 @@ ... x = 12 #: comment2 ... '''string'''""", ... attribs="variables name docstring") + <UNKNOWN> has both a comment-docstring and a normal (string) docstring; ignoring the comment-docstring. ModuleDoc for epydoc_test [0] +- docstring = <UNKNOWN> +- variables @@ -492,6 +496,7 @@ ... class Z(B.__bases__[0]): "calculated base" # not handled! ... """, ... attribs='variables value bases docstring') + Unable to extract the base list for epydoc_test.Z: Bad dotted name ModuleDoc for epydoc_test [0] +- docstring = <UNKNOWN> +- variables Modified: trunk/epydoc/src/epydoc/test/encoding.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/encoding.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/encoding.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -10,7 +10,9 @@ docstrings, it monkey-patches the HMTLwriter.docstring_to_html() method.) - >>> from epydoc.test.util import print_warnings, testencoding + >>> from epydoc.test.util import testencoding + + >>> from epydoc.test.util import print_warnings >>> print_warnings() Encoding Tests Modified: trunk/epydoc/src/epydoc/test/epytext.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/epytext.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/epytext.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -5,6 +5,9 @@ time, esp. given that it's so much easier to write tests with doctest than it was with unittest. + >>> from epydoc.test.util import print_warnings + >>> print_warnings() + >>> from epydoc.markup import epytext >>> import re >>> def testparse(s): Modified: trunk/epydoc/src/epydoc/test/javadoc.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/javadoc.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/javadoc.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -1,5 +1,7 @@ -Regression Testing for plaintext -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Regression Testing for javadoc +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + >>> from epydoc.test.util import print_warnings + >>> print_warnings() Summary ======= Modified: trunk/epydoc/src/epydoc/test/plaintext.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/plaintext.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/plaintext.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -1,5 +1,7 @@ Regression Testing for plaintext ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + >>> from epydoc.test.util import print_warnings + >>> print_warnings() Summary ======= Modified: trunk/epydoc/src/epydoc/test/pyval_repr.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/pyval_repr.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/pyval_repr.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -280,6 +280,9 @@ ... score: 1 (ok) + >>> from epydoc.test.util import print_warnings + >>> print_warnings() + Summary ======= To generate summary-reprs, use maxlines=1 and linebreakok=False: Modified: trunk/epydoc/src/epydoc/test/restructuredtext.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/restructuredtext.doctest 2007-02-14 03:49:21 UTC (rev 1495) +++ trunk/epydoc/src/epydoc/test/restructuredtext.doctest 2007-02-14 03:51:27 UTC (rev 1496) @@ -2,6 +2,9 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :RequireModule: docutils + >>> from epydoc.test.util import print_warnings + >>> print_warnings() + Summary ======= The implementation of the summaization function works as expected. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |