Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
deeb7ca9
Commit
deeb7ca9
authored
Feb 19, 2012
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instead of printing the rewrite chain, append it to the assertion message.
parent
51666c36
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
tests/rulestestcase.py
tests/rulestestcase.py
+18
-8
No files found.
tests/rulestestcase.py
View file @
deeb7ca9
...
...
@@ -45,15 +45,25 @@ class RulesTestCase(unittest.TestCase):
for
i
,
exp
in
enumerate
(
rewrite_chain
[:
-
1
]):
self
.
assertMultiLineEqual
(
str
(
rewrite
(
exp
)),
str
(
rewrite_chain
[
i
+
1
]))
except
AssertionError
:
# pragma: nocover
print
'rewrite failed: "%s" -> "%s"'
\
except
AssertionError
as
e
:
# pragma: nocover
msg
=
e
.
args
[
0
]
msg
+=
'-'
*
30
+
'
\
n
'
msg
+=
'rewrite failed: "%s" -> "%s"
\
n
'
\
%
(
str
(
exp
),
str
(
rewrite_chain
[
i
+
1
]))
print
'rewrite chain index: %d'
%
i
print
'rewrite chain: ---'
for
i
,
c
in
enumerate
(
rewrite_chain
):
print
'%2d %s'
%
(
i
,
str
(
c
))
msg
+=
'rewrite chain: ---
\
n
'
chain
=
[]
for
j
,
c
in
enumerate
(
rewrite_chain
):
if
i
==
j
:
chain
.
append
(
'%2d %s <-- error'
%
(
j
,
str
(
c
)))
else
:
chain
.
append
(
'%2d %s'
%
(
j
,
str
(
c
)))
print
'-'
*
30
e
.
message
=
msg
+
'
\
n
'
.
join
(
chain
)
e
.
args
=
(
e
.
message
,)
+
e
.
args
[
1
:]
raise
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