Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6cd9a1d2
Commit
6cd9a1d2
authored
Dec 03, 2010
by
Michael Foord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 7911: unittest.TestCase.longMessage defaults to True for improved failure messages by default
parent
69cca8b2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
Doc/library/unittest.rst
Doc/library/unittest.rst
+2
-2
Lib/unittest/case.py
Lib/unittest/case.py
+1
-1
Lib/unittest/test/test_assertions.py
Lib/unittest/test/test_assertions.py
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Doc/library/unittest.rst
View file @
6cd9a1d2
...
@@ -1305,8 +1305,8 @@ Test cases
...
@@ -1305,8 +1305,8 @@ Test cases
to ``True`` allows you to have a custom error message in addition to the
to ``True`` allows you to have a custom error message in addition to the
normal one.
normal one.
This attribute defaults to ``
False``, meaning that a custom message passed
This attribute defaults to ``
True``. If set to False then a custom message
to an assert method will silence the normal message.
passed
to an assert method will silence the normal message.
The class setting can be overridden in individual tests by assigning an
The class setting can be overridden in individual tests by assigning an
instance attribute to ``True`` or ``False`` before calling the assert methods.
instance attribute to ``True`` or ``False`` before calling the assert methods.
...
...
Lib/unittest/case.py
View file @
6cd9a1d2
...
@@ -245,7 +245,7 @@ class TestCase(object):
...
@@ -245,7 +245,7 @@ class TestCase(object):
# objects used in assert methods) will be printed on failure in *addition*
# objects used in assert methods) will be printed on failure in *addition*
# to any explicit message passed.
# to any explicit message passed.
longMessage
=
Fals
e
longMessage
=
Tru
e
# This attribute sets the maximum length of a diff in failure messages
# 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
# by assert methods using difflib. It is looked up as an instance attribute
...
...
Lib/unittest/test/test_assertions.py
View file @
6cd9a1d2
...
@@ -127,7 +127,7 @@ class TestLongMessage(unittest.TestCase):
...
@@ -127,7 +127,7 @@ class TestLongMessage(unittest.TestCase):
self
.
testableFalse
=
TestableTestFalse
(
'testTest'
)
self
.
testableFalse
=
TestableTestFalse
(
'testTest'
)
def
testDefault
(
self
):
def
testDefault
(
self
):
self
.
assert
Fals
e
(
unittest
.
TestCase
.
longMessage
)
self
.
assert
Tru
e
(
unittest
.
TestCase
.
longMessage
)
def
test_formatMsg
(
self
):
def
test_formatMsg
(
self
):
self
.
assertEqual
(
self
.
testableFalse
.
_formatMessage
(
None
,
"foo"
),
"foo"
)
self
.
assertEqual
(
self
.
testableFalse
.
_formatMessage
(
None
,
"foo"
),
"foo"
)
...
...
Misc/NEWS
View file @
6cd9a1d2
...
@@ -10,6 +10,9 @@ What's New in Python 3.2 Beta 1?
...
@@ -10,6 +10,9 @@ What's New in Python 3.2 Beta 1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue 7911: `unittest.TestCase.longMessage` defaults to True for improved
failure messages by default. Patch by Mark Roddy.
- Issue #9915: Speed up sorting with a key.
- Issue #9915: Speed up sorting with a key.
- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege
- Issue #9333: Expose os.symlink only when the SeCreateSymbolicLinkPrivilege
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment