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
52bc608c
Commit
52bc608c
authored
Oct 13, 2016
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26869: Document unittest.TestCase.longMessage. (Mariatta)
parent
6bac01a2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
Doc/library/unittest.rst
Doc/library/unittest.rst
+11
-13
No files found.
Doc/library/unittest.rst
View file @
52bc608c
...
@@ -1316,19 +1316,17 @@ Test cases
...
@@ -1316,19 +1316,17 @@ Test cases
.. attribute:: longMessage
.. attribute:: longMessage
If set to ``True`` then any explicit failure message you pass in to the
This class attribute determines what happens when a custom failure message
:ref:`assert methods <assert-methods>` will be appended to the end of the
is passed as the msg argument to an assertXYY call that fails.
normal failure message. The normal messages contain useful information
``True`` is the default value. In this case, the custom message is appended
about the objects involved, for example the message from assertEqual
to the end of the standard failure message.
shows you the repr of the two unequal objects. Setting this attribute
When set to ``False``, the custom message replaces the standard message.
to ``True`` allows you to have a custom error message in addition to the
normal one.
The class setting can be overridden in individual test methods by assigning
an instance attribute, self.longMessage, to ``True`` or ``False`` before
This attribute defaults to ``True``. If set to False then a custom message
calling the assert methods.
passed to an assert method will silence the normal message.
The class setting gets reset before each test call.
The class setting can be overridden in individual tests by assigning an
instance attribute to ``True`` or ``False`` before calling the assert methods.
.. versionadded:: 3.1
.. versionadded:: 3.1
...
...
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