Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_pydoc Namespace Reference

Classes

class  PydocDocTest
class  TestDescriptions
class  PydocServerTest
class  PydocUrlHandlerTest
class  TestHelper

Functions

def run_pydoc
def get_pydoc_html
def get_pydoc_text
def print_diffs
def get_html_title
def test_main

Variables

 threading = None
string expected_text_pattern
string expected_html_pattern
string missing_pattern = "no Python documentation found for '%s'"
string badimport_pattern = "problem in %s - ImportError: No module named %s"

Function Documentation

Definition at line 247 of file test_pydoc.py.

00247 
00248 def get_html_title(text):
00249     # Bit of hack, but good enough for test purposes
00250     header, _, _ = text.partition("</head>")
00251     _, _, title = header.partition("<title>")
00252     title, _, _ = title.partition("</title>")
00253     return title
00254 

Here is the caller graph for this function:

Definition at line 215 of file test_pydoc.py.

00215 
00216 def get_pydoc_html(module):
00217     "Returns pydoc generated output as html"
00218     doc = pydoc.HTMLDoc()
00219     output = doc.docmodule(module)
00220     loc = doc.getdocloc(pydoc_mod) or ""
00221     if loc:
00222         loc = "<br><a href=\"" + loc + "\">Module Docs</a>"
00223     return output.strip(), loc

Here is the caller graph for this function:

Definition at line 224 of file test_pydoc.py.

00224 
00225 def get_pydoc_text(module):
00226     "Returns pydoc generated output as text"
00227     doc = pydoc.TextDoc()
00228     loc = doc.getdocloc(pydoc_mod) or ""
00229     if loc:
00230         loc = "\nMODULE DOCS\n    " + loc + "\n"
00231 
00232     output = doc.docmodule(module)
00233 
00234     # clean up the extra text formatting that pydoc performs
00235     patt = re.compile('\b.')
00236     output = patt.sub('', output)
00237     return output.strip(), loc

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_pydoc.print_diffs (   text1,
  text2 
)

Definition at line 238 of file test_pydoc.py.

00238 
00239 def print_diffs(text1, text2):
00240     "Prints unified diffs for two texts"
00241     # XXX now obsolete, use unittest built-in support
00242     lines1 = text1.splitlines(True)
00243     lines2 = text2.splitlines(True)
00244     diffs = difflib.unified_diff(lines1, lines2, n=0, fromfile='expected',
00245                                  tofile='got')
00246     print('\n' + ''.join(diffs))

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_pydoc.run_pydoc (   module_name,
  args,
  env 
)
Runs pydoc on the specified module. Returns the stripped
output of pydoc.

Definition at line 206 of file test_pydoc.py.

00206 
00207 def run_pydoc(module_name, *args, **env):
00208     """
00209     Runs pydoc on the specified module. Returns the stripped
00210     output of pydoc.
00211     """
00212     args = args + (module_name,)
00213     rc, out, err = assert_python_ok(pydoc.__file__, *args, **env)
00214     return out.strip()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 511 of file test_pydoc.py.

00511 
00512 def test_main():
00513     try:
00514         test.support.run_unittest(PydocDocTest,
00515                                   TestDescriptions,
00516                                   PydocServerTest,
00517                                   PydocUrlHandlerTest,
00518                                   TestHelper,
00519                                   )
00520     finally:
00521         reap_children()

Here is the call graph for this function:


Variable Documentation

string test.test_pydoc.badimport_pattern = "problem in %s - ImportError: No module named %s"

Definition at line 204 of file test_pydoc.py.

Definition at line 101 of file test_pydoc.py.

Definition at line 36 of file test_pydoc.py.

string test.test_pydoc.missing_pattern = "no Python documentation found for '%s'"

Definition at line 201 of file test_pydoc.py.

Definition at line 30 of file test_pydoc.py.