summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-03-07 09:21:06 (GMT)
committerGeorg Brandl <georg@python.org>2007-03-07 09:21:06 (GMT)
commitd0a962506bd69d94dcd740a9555140d09b8cf2b5 (patch)
tree7d6c988c264deacfb154fd97871772335e756de1 /Doc
parent15c5ce936f8dd2d83a02707efbeb88531f7514af (diff)
downloadcpython-d0a962506bd69d94dcd740a9555140d09b8cf2b5.zip
cpython-d0a962506bd69d94dcd740a9555140d09b8cf2b5.tar.gz
cpython-d0a962506bd69d94dcd740a9555140d09b8cf2b5.tar.bz2
Patch #787789: allow to pass custom TestRunner instances to unittest's
main() function.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libunittest.tex6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/lib/libunittest.tex b/Doc/lib/libunittest.tex
index 350abae..782c6ed 100644
--- a/Doc/lib/libunittest.tex
+++ b/Doc/lib/libunittest.tex
@@ -290,6 +290,7 @@ Often, many small test cases will use the same fixture. In this case,
we would end up subclassing \class{SimpleWidgetTestCase} into many
small one-method classes such as
\class{DefaultWidgetSizeTestCase}. This is time-consuming and
+
discouraging, so in the same vein as JUnit, \module{unittest} provides
a simpler mechanism:
@@ -540,7 +541,7 @@ easier.}
\begin{funcdesc}{main}{\optional{module\optional{,
defaultTest\optional{, argv\optional{,
- testRunner\optional{, testRunner}}}}}}
+ testRunner\optional{, testLoader}}}}}}
A command-line program that runs a set of tests; this is primarily
for making test modules conveniently executable. The simplest use
for this function is to include the following line at the end of a
@@ -550,6 +551,9 @@ easier.}
if __name__ == '__main__':
unittest.main()
\end{verbatim}
+
+ The \var{testRunner} argument can either be a test runner class or
+ an already created instance of it.
\end{funcdesc}
In some cases, the existing tests may have been written using the