Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update doctest.rst
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
  • Loading branch information
donbarbos and picnixz authored Mar 16, 2025
commit a5c8c5954d124e121768696d546ef648513545c7
9 changes: 5 additions & 4 deletions Doc/library/doctest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,11 @@ The :mod:`doctest` module can be invoked as a script from the command line:
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`, not :func:`testmod`::
: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
Comment thread
donbarbos marked this conversation as resolved.

Expand Down
Loading