Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue5663

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Better failure messages for unittest assertions
Type:behaviorStage:
Components:Library (Lib)Versions:Python 2.7
process
Status:closedResolution:accepted
Dependencies:Superseder:
Assigned To:Nosy List: michael.foord, michael.foord
Priority:normalKeywords:patch

Created on2009-04-02 01:58 bymichael.foord, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
unittest-messages.diffmichael.foord,2009-04-02 01:58
unittest-messages.diffmichael.foord,2009-04-02 03:12
Messages (3)
msg85136 -(view)Author: Michael Foord (michael.foord)*(Python committer)Date: 2009-04-02 01:58
Patch for unittest on trunk.It provides better default failure messages for assertTrue andassertFalse (current is "AssertionError: None").It also provides a new class attribute for TestCase: longMessageThis defaults to False. If set to True, passing in an explicit custommessage does *not* override the helpful default failure message inasserts which tell you which objects were involved in the failure.Even if set to True or False in a TestCase then longMessage can still beoverridden in individual tests by setting an instance attribute.Needs docs.Could longMessage default to True in 3.1.
msg85137 -(view)Author: Michael Foord (michael.foord)*(Python committer)Date: 2009-04-02 02:02
Reviewers: ,Description:Patch for unittest on trunk.It provides better default failure messages for assertTrue andassertFalse (current is "AssertionError: None").It also provides a new class attribute for TestCase: longMessageThis defaults to False. If set to True, passing in an explicit custommessage does *not* override the helpful default failure message inasserts which tell you which objects were involved in the failure.Even if set to True or False in a TestCase then longMessage can still beoverridden in individual tests by setting an instance attribute.Needs docs.Could longMessage default to True in 3.1?Please review this athttp://codereview.appspot.com/32102Affected files:Lib/test/test_unittest.pyLib/unittest.pyMisc/NEWS
msg85150 -(view)Author: Michael Foord (michael.foord)*(Python committer)Date: 2009-04-02 03:12
Updated patch with better docstring for _formatMessage and docs.Patch reviewed by Brett Cannon so will commit.
History
DateUserActionArgs
2022-04-11 14:56:47adminsetgithub: 49913
2009-04-02 03:22:52michael.foordsetstatus: open -> closed
resolution: accepted
2009-04-02 03:12:42michael.foordsetfiles: +unittest-messages.diff

messages: +msg85150
2009-04-02 02:02:23fuzzymansetnosy: +fuzzyman
messages: +msg85137
2009-04-02 01:58:39michael.foordcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp