summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-06-05 21:57:03 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-06-05 21:57:03 (GMT)
commit8dde20168aff434a662e0ee1af5d0c63a6f5c05b (patch)
treecdf521f241aa49ae725bf3eb54c9d3b7241e141d /Doc/library
parentdb919f01884e8c93506db7d54325d4e68e61861b (diff)
downloadcpython-8dde20168aff434a662e0ee1af5d0c63a6f5c05b.zip
cpython-8dde20168aff434a662e0ee1af5d0c63a6f5c05b.tar.gz
cpython-8dde20168aff434a662e0ee1af5d0c63a6f5c05b.tar.bz2
Documentation updates for issues 8302 and 8351 (truncating excessive diffs in unittest failure messages and reporting SkipTest exceptions in setUpClass and setUpModule as skips rather than errors).
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/unittest.rst23
1 files changed, 21 insertions, 2 deletions
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index 0c179bb..0ef2e03 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -1150,6 +1150,21 @@ Test cases
.. versionadded:: 2.7
+ .. attribute:: maxDiff
+
+ This attribute controls the maximum length of diffs output by assert
+ methods that report diffs on failure. It defaults to 80*8 characters.
+ Assert methods affected by this attribute are
+ :meth:`assertSequenceEqual` (including all the sequence comparison
+ methods that delegate to it), :meth:`assertDictEqual` and
+ :meth:`assertMultiLineEqual`.
+
+ Setting ``maxDiff`` to None means that there is no maximum length of
+ diffs.
+
+ .. versionadded:: 2.7
+
+
Testing frameworks can use the following methods to collect information on
the test:
@@ -1848,7 +1863,9 @@ then you must call up to them yourself. The implementations in
If an exception is raised during a ``setUpClass`` then the tests in the class
are not run and the ``tearDownClass`` is not run. Skipped classes will not
-have ``setUpClass`` or ``tearDownClass`` run.
+have ``setUpClass`` or ``tearDownClass`` run. If the exception is a
+``SkipTest`` exception then the class will be reported as having been skipped
+instead of as an error.
setUpModule and tearDownModule
@@ -1863,7 +1880,9 @@ These should be implemented as functions::
closeConnection()
If an exception is raised in a ``setUpModule`` then none of the tests in the
-module will be run and the ``tearDownModule`` will not be run.
+module will be run and the ``tearDownModule`` will not be run. If the exception is a
+``SkipTest`` exception then the module will be reported as having been skipped
+instead of as an error.
Signal Handling