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
3044fa77
Commit
3044fa77
authored
14 years ago
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use lowercase true/false in assertTrue/assertFalse messages.
parent
b68a7bc7
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Lib/unittest/case.py
Lib/unittest/case.py
+4
-4
Lib/unittest/test/test_assertions.py
Lib/unittest/test/test_assertions.py
+4
-4
No files found.
Lib/unittest/case.py
View file @
3044fa77
...
...
@@ -477,15 +477,15 @@ class TestCase(object):
raise
self
.
failureException
(
msg
)
def
assertFalse
(
self
,
expr
,
msg
=
None
):
"
Fail the test if the expression is true.
"
"
""Check that the expression is false.""
"
if
expr
:
msg
=
self
.
_formatMessage
(
msg
,
"%s is not
F
alse"
%
safe_repr
(
expr
))
msg
=
self
.
_formatMessage
(
msg
,
"%s is not
f
alse"
%
safe_repr
(
expr
))
raise
self
.
failureException
(
msg
)
def
assertTrue
(
self
,
expr
,
msg
=
None
):
"""
Fail the test unless
the expression is true."""
"""
Check that
the expression is true."""
if
not
expr
:
msg
=
self
.
_formatMessage
(
msg
,
"%s is not
T
rue"
%
safe_repr
(
expr
))
msg
=
self
.
_formatMessage
(
msg
,
"%s is not
t
rue"
%
safe_repr
(
expr
))
raise
self
.
failureException
(
msg
)
def
_formatMessage
(
self
,
msg
,
standardMsg
):
...
...
This diff is collapsed.
Click to expand it.
Lib/unittest/test/test_assertions.py
View file @
3044fa77
...
...
@@ -166,13 +166,13 @@ class TestLongMessage(unittest.TestCase):
def
testAssertTrue
(
self
):
self
.
assertMessages
(
'assertTrue'
,
(
False
,),
[
"^False is not
True$"
,
"^oops$"
,
"^False is not T
rue$"
,
"^False is not
T
rue : oops$"
])
[
"^False is not
true$"
,
"^oops$"
,
"^False is not t
rue$"
,
"^False is not
t
rue : oops$"
])
def
testAssertFalse
(
self
):
self
.
assertMessages
(
'assertFalse'
,
(
True
,),
[
"^True is not
False$"
,
"^oops$"
,
"^True is not F
alse$"
,
"^True is not
F
alse : oops$"
])
[
"^True is not
false$"
,
"^oops$"
,
"^True is not f
alse$"
,
"^True is not
f
alse : oops$"
])
def
testNotEqual
(
self
):
self
.
assertMessages
(
'assertNotEqual'
,
(
1
,
1
),
...
...
This diff is collapsed.
Click to expand it.
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