diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-29 01:43:38 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-29 01:43:38 (GMT) |
commit | 85a25222bcad7d2d059e7b5c00b2bff5e2a6e7c7 (patch) | |
tree | 41306e0a96b62f4d176afbe42bc062dc3c8de380 /Lib/unittest | |
parent | 2463e5fee48b116a5f15cf703abe30e08ce114ca (diff) | |
parent | 31797e5efe9c275b59d3b87998428ee50a9830a9 (diff) | |
download | cpython-85a25222bcad7d2d059e7b5c00b2bff5e2a6e7c7.zip cpython-85a25222bcad7d2d059e7b5c00b2bff5e2a6e7c7.tar.gz cpython-85a25222bcad7d2d059e7b5c00b2bff5e2a6e7c7.tar.bz2 |
#8906: merge with 3.3.
Diffstat (limited to 'Lib/unittest')
-rw-r--r-- | Lib/unittest/case.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 881a690..d04ea61 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -252,24 +252,23 @@ class TestCase(object): 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. - """ - # 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' + 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. + """ 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 |