This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Detailed report of all examples tried is printed to standard output,
along with assorted summaries at the end::
python -m doctest -v example.py
This will import :file:`example.py` as a standalone module and run
:func:`testmod` on it. Note that this may not work correctly if the
file is part of a package and imports other submodules from that package.
If the file name does not end with :file:`.py`, :mod:`!doctest` infers
that it must be run with :func:`testfile` instead::
python -m doctest -v example.txt
.. option:: -o, --option <option>
Option flags control various aspects of doctest's behavior, see section
:ref:`doctest-options`.
.. versionadded:: 3.4
.. option:: -f, --fail-fast
This is shorthand for ``-o FAIL_FAST``.
.. versionadded:: 3.4
.. _doctest-how-it-works:
Expand Down
Expand Up
@@ -540,9 +570,6 @@ Symbolic names for the flags are supplied as module constants, which can be
The names can also be used in :ref:`doctest directives <doctest-directives>`,
and may be passed to the doctest command line interface via the ``-o`` option.
.. versionadded:: 3.4
The ``-o`` command line option.
The first group of options define test semantics, controlling aspects of how
doctest decides whether actual output matches an example's expected output:
Expand Down
Expand Up
@@ -682,11 +709,6 @@ The second group of options controls how test failures are reported:
1. This flag may be useful during debugging, since examples after the first
failure won't even produce debugging output.
The doctest command line accepts the option ``-f`` as a shorthand for ``-o
FAIL_FAST``.
.. versionadded:: 3.4
.. data:: REPORTING_FLAGS
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gh-130160: use .. program:: directive for documenting doctest CLI #131034
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-130160: use .. program:: directive for documenting doctest CLI #131034
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing