Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lettuce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
lettuce
Commits
697e21b8
Commit
697e21b8
authored
Aug 22, 2013
by
Danielle Madeley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Python 2.6 compatible format usage
parent
0d9dcb4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
lettuce/plugins/subunit_output.py
+7
-3
tests/functional/test_subunit_output.py
+7
-3
No files found.
lettuce/plugins/subunit_output.py
View file @
697e21b8
...
...
@@ -28,7 +28,7 @@ def open_file(filename):
this is not a context manager because it is used asynchronously by
hooks
out of the scope of enable() because we want to patch it in our tests
"""
...
...
@@ -113,7 +113,9 @@ def enable(filename=None):
else
:
raise
AssertionError
(
"Internal error"
)
steps
=
u'{} {}
\n
'
.
format
(
marker
,
step
.
sentence
)
steps
=
u'{marker} {sentence}
\n
'
.
format
(
marker
=
marker
,
sentence
=
step
.
sentence
)
streamresult
.
status
(
test_id
=
get_test_id
(
step
.
scenario
),
file_name
=
'steps'
,
file_bytes
=
steps
.
encode
(
'utf-8'
),
...
...
@@ -127,4 +129,6 @@ def enable(filename=None):
def
get_test_id
(
scenario
):
return
'{}: {}'
.
format
(
scenario
.
feature
.
name
,
scenario
.
name
)
return
'{feature}: {scenario}'
.
format
(
feature
=
scenario
.
feature
.
name
,
scenario
=
scenario
.
name
)
tests/functional/test_subunit_output.py
View file @
697e21b8
...
...
@@ -36,7 +36,9 @@ class Includes(object):
return
all
((
v
==
a
[
k
]
for
k
,
v
in
self
.
d
.
iteritems
()))
def
__repr__
(
self
):
return
'{}({})'
.
format
(
self
.
__class__
.
__name__
,
self
.
d
)
return
'{klass}({d})'
.
format
(
klass
=
self
.
__class__
.
__name__
,
d
=
self
.
d
)
class
Keys
(
object
):
...
...
@@ -57,7 +59,9 @@ class ContentContains(object):
return
self
.
text
in
a
.
as_text
()
def
__repr__
(
self
):
return
'{}({})'
.
format
(
self
.
__class__
.
__name__
,
self
.
text
)
return
'{klass}({text})'
.
format
(
klass
=
self
.
__class__
.
__name__
,
text
=
self
.
text
)
class
State
(
object
):
...
...
@@ -68,7 +72,7 @@ class State(object):
try
:
d
=
self
.
expect
.
pop
(
0
)
except
IndexError
:
raise
AssertionError
(
"Unexpected {
}"
.
format
(
test
))
raise
AssertionError
(
"Unexpected {
test}"
.
format
(
test
=
test
))
assert_equal
(
d
,
test
)
...
...
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