doctest.register_optionflag
Prev: doctest.OutputChecker | Up: doctest | Next: doctest.run_docstring_examples
Rel: doctest.debug, doctest.debug_src, doctest.DebugRunner, doctest.DocFileSuite
Ref: docs.python.org — doctest.register_optionflag
Tags: #public #python3 #stdlib #doctest
Import
import doctest
from doctest import register_optionflag
Signature & Overview
doctest.register_optionflag(name)
doctest.register_optionflag() function.
Usage
import doctest
flag = doctest.register_optionflag("DEMO_CUSTOM_FLAG")
assert isinstance(flag, int) and flag > 0
Gotchas
- Allows custom
# doctest: +MY_FLAGdirectives paired with a customOutputChecker.
REPL Inspect
from doctest import register_optionflag
help(register_optionflag)
Linked from
Related notes
- tuts/python3/stdlib_module/doctest/OutputChecker Linked here; links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/run_docstring_examples Linked here; links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/debug Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/debug_src Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DebugRunner Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocFileSuite Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTest Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/doctest/DocTestFailure shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestFinder shared tags: #doctest, #stdlib