Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2349)

Issue 32102: [issue5663] Better failure messages for unittest assertions

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 8 months ago by fuzzyman
Modified:
15 years, 8 months ago
Reviewers:
CC:
report_bugs.python.org
Base URL:
http://svn.python.org/view/*checkout*/python/trunk/
Visibility:
Public.

Description

Patch for unittest on trunk. It provides better default failure messages for assertTrue and assertFalse (current is "AssertionError: None"). It also provides a new class attribute for TestCase: longMessage This defaults to False. If set to True, passing in an explicit custom message does *not* override the helpful default failure message in asserts which tell you which objects were involved in the failure. Even if set to True or False in a TestCase then longMessage can still be overridden in individual tests by setting an instance attribute. Needs docs. Could longMessage default to True in 3.1?

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+265 lines, -70 lines) Patch
Lib/test/test_unittest.py View 4 chunks +171 lines, -1 line 0 comments Download
Lib/unittest.py View 12 chunks +91 lines, -69 lines 0 comments Download
Misc/NEWS View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 1
fuzzyman
15 years, 8 months ago (2009-04-02 02:02:21 UTC) #1

          
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b