Onyx logo

Previous topic

onyx.builtin – Low-level containers and mixin classes, candidates for being builtin.

Next topic

onyx.istext – Classifies file data into text or binary, with line-ending and tab flags.

This Page

onyx.doctestmod – Module for running of doctest on Onyx modules.

Due to recursive issues it is impractical for this module to doctest itself. See onyx.__init__._test_doctest_functions() for tests.

onyx.doctestmod.doctestmod(module=None)

A doctest wrapper that runs doctest.testmod() on the module. It returns a tuple: (num_ok, num_bad, string with a summary of the testing results). The one-line string is prefixed with the value of DOCTESTMODTAG and terminated with a newline.

Optional ‘module’ argument is the module to test. If not given, or None, the module called ‘__main__’ will be used.

This function is particularly difficult to test other than functionally in the working system.

onyx.doctestmod.make_doctest_message(fullfile, num_bad, num_test, elapsed_time_sec)

Create a well-defined error message for summarizing doctests.

See onyx.__init__._test_doctest_functions() for tests which will have to be updated if the formatting of the doctest msg is changed.

onyx.doctestmod.matcher()

match(string[, pos[, endpos]]) –> match object or None. Matches zero or more characters at the beginning of the string

onyx.doctestmod.parse_doctest_message(msg)

Attempt to parse a message generated by doctestmod().

Returns None if the parse failed. Returns a tuple (tag, module_name, total, ok, bad, passfail) where tag should be the value of DOCTESTMOD; module_name is the module’s name; total, ok, and bad are integers summarizing the test results; and passfail is a string with the pass or fail message

See onyx.__init__._test_doctest_functions() for tests.