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
3692453a
Commit
3692453a
authored
Feb 29, 2012
by
Nadeem Vawda
Browse files
Options
Browse Files
Download
Plain Diff
Merge: Give better failure messages in test_strptime (cf. issue #14113).
parents
0109e3cd
aba2b060
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Lib/test/test_strptime.py
Lib/test/test_strptime.py
+8
-8
No files found.
Lib/test/test_strptime.py
View file @
3692453a
...
...
@@ -38,7 +38,7 @@ class LocaleTime_Tests(unittest.TestCase):
comparison
=
testing
[
self
.
time_tuple
[
tuple_position
]]
self
.
assertIn
(
strftime_output
,
testing
,
"%s: not found in tuple"
%
error_msg
)
self
.
assert
True
(
comparison
==
strftime_output
,
self
.
assert
Equal
(
comparison
,
strftime_output
,
"%s: position within tuple incorrect; %s != %s"
%
(
error_msg
,
comparison
,
strftime_output
))
...
...
@@ -65,7 +65,7 @@ class LocaleTime_Tests(unittest.TestCase):
"AM/PM representation not in tuple"
)
if
self
.
time_tuple
[
3
]
<
12
:
position
=
0
else
:
position
=
1
self
.
assert
True
(
strftime_output
==
self
.
LT_ins
.
am_pm
[
position
]
,
self
.
assert
Equal
(
self
.
LT_ins
.
am_pm
[
position
],
strftime_output
,
"AM/PM representation in the wrong position within the tuple"
)
def
test_timezone
(
self
):
...
...
@@ -165,7 +165,7 @@ class TimeRETests(unittest.TestCase):
# Fixes bug #661354
test_locale = _strptime.LocaleTime()
test_locale.timezone = (frozenset(), frozenset())
self.assert
True(_strptime.TimeRE(test_locale).pattern("
%
Z
") ==
'',
self.assert
Equal(_strptime.TimeRE(test_locale).pattern("
%
Z
"),
'',
"
with
timezone
==
(
''
,
''
),
TimeRE
().
pattern
(
'%Z'
)
!=
''")
def test_matching_with_escapes(self):
...
...
@@ -192,7 +192,7 @@ class TimeRETests(unittest.TestCase):
# so as to not allow to subpatterns to end up next to each other and
# "
steal
" characters from each other.
pattern = self.time_re.pattern('%j %H')
self.assert
True(not
re.match(pattern, "
180
"))
self.assert
False(
re.match(pattern, "
180
"))
self.assertTrue(re.match(pattern, "
18
0
"))
...
...
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