[Python-checkins] r81768 - in python/branches/py3k: Doc/library/unittest.rst

michael.foord python-checkins at python.org
Sat Jun 5 23:59:55 CEST 2010


Author: michael.foord
Date: Sat Jun  5 23:59:55 2010
New Revision: 81768

Log:
Merged revisions 81767 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81767 | michael.foord | 2010-06-05 22:57:03 +0100 (Sat, 05 Jun 2010) | 1 line
  
  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).
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Doc/library/unittest.rst

Modified: python/branches/py3k/Doc/library/unittest.rst
==============================================================================
--- python/branches/py3k/Doc/library/unittest.rst	(original)
+++ python/branches/py3k/Doc/library/unittest.rst	Sat Jun  5 23:59:55 2010
@@ -1168,6 +1168,21 @@
       .. versionadded:: 3.1
 
 
+   .. 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:: 3.2
+
+
    Testing frameworks can use the following methods to collect information on
    the test:
 
@@ -1862,7 +1877,9 @@
 
 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
@@ -1877,7 +1894,9 @@
         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


More information about the Python-checkins mailing list