diff options
author | Éric Araujo <merwok@netwok.org> | 2010-12-16 01:40:26 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-12-16 01:40:26 (GMT) |
commit | 1d55c7ea9bdd25a9ed6d6c12e1170d14ad5bb9ab (patch) | |
tree | 57ec6edd5d7c56a4c18f5b28b38847622ab0bbda /Doc/library | |
parent | 7f64c8a5121576fd8f92010b7a936b89581c4051 (diff) | |
download | cpython-1d55c7ea9bdd25a9ed6d6c12e1170d14ad5bb9ab.zip cpython-1d55c7ea9bdd25a9ed6d6c12e1170d14ad5bb9ab.tar.gz cpython-1d55c7ea9bdd25a9ed6d6c12e1170d14ad5bb9ab.tar.bz2 |
Advertise “python -m test” over test.regrtest (r87296 followup)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/test.rst | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Doc/library/test.rst b/Doc/library/test.rst index b327d2d..1cddcc6 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -154,28 +154,31 @@ guidelines to be followed: .. _regrtest: -Running tests using :mod:`test.regrtest` ----------------------------------------- +Running tests using the command-line interface +---------------------------------------------- -:mod:`test.regrtest` can be used as a script to drive Python's regression test -suite. Running the script by itself automatically starts running all regression +The :mod:`test` package can be run as a script to drive Python's regression +test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under +the hood, it uses :mod:`test.regrtest`; the call :program:`python -m +test.regrtest` used in previous Python versions still works). +Running the script by itself automatically starts running all regression tests in the :mod:`test` package. It does this by finding all modules in the package whose name starts with ``test_``, importing them, and executing the function :func:`test_main` if present. The names of tests to execute may also be passed to the script. Specifying a single regression test (:program:`python -regrtest.py test_spam.py`) will minimize output and only print +-m test test_spam`) will minimize output and only print whether the test passed or failed and thus minimize output. -Running :mod:`test.regrtest` directly allows what resources are available for +Running :mod:`test` directly allows what resources are available for tests to use to be set. You do this by using the ``-u`` command-line -option. Run :program:`python -m regrtest -uall` to turn on all +option. Run :program:`python -m test -uall` to turn on all resources; specifying ``all`` as an option for ``-u`` enables all possible resources. If all but one resource is desired (a more common case), a comma-separated list of resources that are not desired may be listed after -``all``. The command :program:`python -m regrtest -uall,-audio,-largefile` -will run :mod:`test.regrtest` with all resources except the ``audio`` and +``all``. The command :program:`python -m test -uall,-audio,-largefile` +will run :mod:`test` with all resources except the ``audio`` and ``largefile`` resources. For a list of all resources and more command-line -options, run :program:`python -m regrtest -h`. +options, run :program:`python -m test -h`. Some other ways to execute the regression tests depend on what platform the tests are being executed on. On Unix, you can run :program:`make test` at the |