PyDocs

Nav

Development Tools

DocTest

doctest

class (source)
  • DocTest(examples, globs, name, filename, lineno, docstring)
A collection of doctest examples that should be run in a single
namespace.  Each `DocTest` defines the following attributes:

  - examples: the list of examples.

  - globs: The namespace (aka globals) that the examples should
    be run in.

  - name: A name identifying the DocTest (typically, the name of
    the object whose docstring this DocTest was extracted from).

  - filename: The name of the file that this DocTest was extracted
    from, or `None` if the filename is unknown.

  - lineno: The line number within filename where this DocTest
    begins, or `None` if the line number is unavailable.  This
    line number is zero-based, with respect to the beginning of
    the file.

  - docstring: The string that the examples were extracted from,
    or `None` if the string is unavailable.
Members of DocTest

d

docstring
The string that the test was extracted from, or None if the string is unavailable, or if the test was not extracted from a string.

e

examples
A list of Example objects encoding the individual interactive Python examples that should be run by this test.

f

filename
The name of the file that this DocTest was extracted from; or None if the filename is unknown, or if the DocTest was not extracted from a file.

g

globs
The namespace (aka globals) that the examples should be run in.

l

lineno
The line number within filename where this DocTest begins, or None if the line number is unavailable.

n

name
A string name identifying the DocTest.
0 Examples
No examples for doctest/DocTest.
See Also
No see-alsos for doctest/DocTest
0 Notes
No notes for DocTest