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
94deeb39
Commit
94deeb39
authored
Nov 26, 2010
by
Gabriel Falcão
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verbosity level 2 handling failed scenarios
parent
5a3e7e7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
lettuce/core.py
+4
-0
tests/functional/test_runner.py
+29
-2
No files found.
lettuce/core.py
View file @
94deeb39
...
@@ -514,6 +514,10 @@ class Scenario(object):
...
@@ -514,6 +514,10 @@ class Scenario(object):
def
passed
(
self
):
def
passed
(
self
):
return
self
.
ran
and
all
([
step
.
passed
for
step
in
self
.
steps
])
return
self
.
ran
and
all
([
step
.
passed
for
step
in
self
.
steps
])
@property
def
failed
(
self
):
return
any
([
step
.
failed
for
step
in
self
.
steps
])
def
run
(
self
,
ignore_case
):
def
run
(
self
,
ignore_case
):
"""Runs a scenario, running each of its steps. Also call
"""Runs a scenario, running each of its steps. Also call
before_each and after_each callbacks for steps and scenario"""
before_each and after_each callbacks for steps and scenario"""
...
...
tests/functional/test_runner.py
View file @
94deeb39
...
@@ -893,8 +893,8 @@ def test_output_snippets_with_normalized_unicode_names():
...
@@ -893,8 +893,8 @@ def test_output_snippets_with_normalized_unicode_names():
)
)
@with_setup
(
prepare_stdout
)
@with_setup
(
prepare_stdout
)
def
test_output_level_2
():
def
test_output_level_2
_success
():
'Output with verbosity 2 must show only the scenario names, followed by "... OK"
or "... FAIL" or "... ERROR"
'
'Output with verbosity 2 must show only the scenario names, followed by "... OK"
in case of success
'
runner
=
Runner
(
join
(
abspath
(
dirname
(
__file__
)),
'output_features'
,
'many_successful_scenarios'
),
verbosity
=
2
)
runner
=
Runner
(
join
(
abspath
(
dirname
(
__file__
)),
'output_features'
,
'many_successful_scenarios'
),
verbosity
=
2
)
runner
.
run
()
runner
.
run
()
...
@@ -907,3 +907,30 @@ def test_output_level_2():
...
@@ -907,3 +907,30 @@ def test_output_level_2():
"2 scenarios (2 passed)
\n
"
"2 scenarios (2 passed)
\n
"
"2 steps (2 passed)
\n
"
"2 steps (2 passed)
\n
"
)
)
@with_setup
(
prepare_stdout
)
def
test_output_level_2_fail
():
'Output with verbosity 2 must show only the scenario names, followed by "... FAILED" in case of fail'
runner
=
Runner
(
feature_name
(
'failed_table'
),
verbosity
=
2
)
runner
.
run
()
assert_stdout_lines_with_traceback
(
"See it fail ... FAILED
\n
"
"
\n
"
"Traceback (most recent call last):
\n
"
' File "
%(lettuce_core_file)
s", line
%(call_line)
d, in __call__
\n
'
" ret = self.function(self.step, *args, **kw)
\n
"
' File "
%(step_file)
s", line 25, in tof
\n
'
" assert False
\n
"
"AssertionError
\n
"
"
\n
"
"1 feature (0 passed)
\n
"
"1 scenario (0 passed)
\n
"
"5 steps (1 failed, 2 skipped, 1 undefined, 1 passed)
\n
"
%
{
'lettuce_core_file'
:
lettuce_path
(
'core.py'
),
'step_file'
:
abspath
(
lettuce_path
(
'..'
,
'tests'
,
'functional'
,
'output_features'
,
'failed_table'
,
'failed_table_steps.py'
)),
'call_line'
:
call_line
,
}
)
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