Skip to content

Commit d218e95

Browse files
author
Michael Foord
committed
Issue 10786: unittest documentation update.
1 parent e33b7c6 commit d218e95

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Doc/library/unittest.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,9 +1870,10 @@ Loading and running tests
18701870
instead of repeatedly creating new instances.
18711871

18721872

1873-
.. class:: TextTestRunner(stream=sys.stderr, descriptions=True, verbosity=1, runnerclass=None, warnings=None)
1873+
.. class:: TextTestRunner(stream=None, descriptions=True, verbosity=1, runnerclass=None, warnings=None)
18741874

1875-
A basic test runner implementation which prints results on standard error. It
1875+
A basic test runner implementation that outputs results to a stream. If *stream*
1876+
is `None`, the default, `sys.stderr` is used as the output stream. This class
18761877
has a few configurable parameters, but is essentially very simple. Graphical
18771878
applications which run test suites should provide alternate implementations.
18781879

@@ -1885,6 +1886,13 @@ Loading and running tests
18851886
messages. This behavior can be overridden using the :option:`-Wd` or
18861887
:option:`-Wa` options and leaving *warnings* to ``None``.
18871888

1889+
.. versionchanged:: 3.2
1890+
Added the ``warnings`` argument.
1891+
1892+
.. versionchanged:: 3.2
1893+
The default stream is set to `sys.stderr` at instantiation time rather
1894+
than import time.
1895+
18881896
.. method:: _makeResult()
18891897

18901898
This method returns the instance of ``TestResult`` used by :meth:`run`.
@@ -1898,8 +1906,6 @@ Loading and running tests
18981906

18991907
stream, descriptions, verbosity
19001908

1901-
.. versionchanged:: 3.2
1902-
Added the ``warnings`` argument.
19031909

19041910
.. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, \
19051911
testLoader=unittest.loader.defaultTestLoader, exit=True, verbosity=1, \

0 commit comments

Comments
 (0)