#17282: Document unittest.main defaultTest argument.

This commit is contained in:
R David Murray 2014-01-02 13:37:26 -05:00
parent 3e6ab1715d
commit 12e930f3a4
1 changed files with 4 additions and 0 deletions

View File

@ -1801,6 +1801,10 @@ Loading and running tests
if __name__ == '__main__': if __name__ == '__main__':
unittest.main(verbosity=2) unittest.main(verbosity=2)
The *defaultTest* argument is the name of the test to run if no test names
are specified via *argv*. If not specified or ``None`` and no test names are
provided via *argv*, all tests found in *module* are run.
The *argv* argument can be a list of options passed to the program, with the The *argv* argument can be a list of options passed to the program, with the
first element being the program name. If not specified or ``None``, first element being the program name. If not specified or ``None``,
the values of :data:`sys.argv` are used. the values of :data:`sys.argv` are used.