[Python-checkins] cpython (merge 3.3 -> default): #8906: merge with 3.3.
ezio.melotti
python-checkins at python.org
Fri Mar 29 02:44:05 CET 2013
http://hg.python.org/cpython/rev/49cf8f656e9e
changeset: 82995:49cf8f656e9e
parent: 82992:02a89bd646ca
parent: 82994:b1c511418b29
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Fri Mar 29 03:43:38 2013 +0200
summary:
#8906: merge with 3.3.
files:
Lib/unittest/case.py | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -252,24 +252,23 @@
should not change the signature of their __init__ method, since instances
of the classes are instantiated automatically by parts of the framework
in order to be run.
+
+ When subclassing TestCase, you can set these attributes:
+ * failureException: determines which exception will be raised when
+ the instance's assertion methods fail; test methods raising this
+ exception will be deemed to have 'failed' rather than 'errored'.
+ * longMessage: determines whether long messages (including repr of
+ objects used in assert methods) will be printed on failure in *addition*
+ to any explicit message passed.
+ * maxDiff: sets the maximum length of a diff in failure messages
+ by assert methods using difflib. It is looked up as an instance
+ attribute so can be configured by individual tests if required.
"""
- # This attribute determines which exception will be raised when
- # the instance's assertion methods fail; test methods raising this
- # exception will be deemed to have 'failed' rather than 'errored'
-
failureException = AssertionError
- # This attribute determines whether long messages (including repr of
- # objects used in assert methods) will be printed on failure in *addition*
- # to any explicit message passed.
-
longMessage = True
- # This attribute sets the maximum length of a diff in failure messages
- # by assert methods using difflib. It is looked up as an instance attribute
- # so can be configured by individual tests if required.
-
maxDiff = 80*8
# If a string is longer than _diffThreshold, use normal comparison instead
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list