Loader: Doctests

Load tests from doctests.

This plugin implements handleFile() to load doctests from text files and python modules.

To disable loading doctests from text files, configure an empty extensions list:

[doctest]
extensions =

Configuration [doctest]

always-on
Default :False
Type :boolean
extensions
Default :[‘.txt’, ‘.rst’]
Type :list

Sample configuration

The default configuration is equivalent to including the following in a unittest.cfg file.

[doctest]
always-on = False
extensions = .txt
             .rst

Command-line options

--with-doctest DEFAULT

Load doctests from text files and modules

Plugin class reference: DocTestLoader

class nose2.plugins.doctests.DocTestLoader[source]
handleFile(event)[source]

Load doctests from text files and modules