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
fefb3160
Commit
fefb3160
authored
Apr 29, 2010
by
Gabriel Falcão
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
traceback on failed, with colorless output
parent
003a47ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
5 deletions
+33
-5
lettuce/core.py
+8
-0
lettuce/plugins/shell_output.py
+22
-2
tests/functional/test_runner.py
+3
-3
No files found.
lettuce/core.py
View file @
fefb3160
...
...
@@ -551,12 +551,20 @@ class TotalResult(object):
self
.
feature_results
=
feature_results
self
.
scenario_results
=
[]
self
.
steps_passed
=
0
self
.
steps_failed
=
0
self
.
steps_skipped
=
0
self
.
steps_undefined
=
0
self
.
proposed_definitions
=
[]
self
.
steps
=
0
for
feature_result
in
self
.
feature_results
:
for
scenario_result
in
feature_result
.
scenario_results
:
self
.
scenario_results
.
append
(
scenario_result
)
self
.
steps_passed
+=
len
(
scenario_result
.
steps_passed
)
self
.
steps_failed
+=
len
(
scenario_result
.
steps_failed
)
self
.
steps_skipped
+=
len
(
scenario_result
.
steps_skipped
)
self
.
steps_undefined
+=
len
(
scenario_result
.
steps_undefined
)
self
.
steps
+=
scenario_result
.
total_steps
self
.
proposed_definitions
.
extend
(
scenario_result
.
steps_undefined
)
@property
def
features_ran
(
self
):
...
...
lettuce/plugins/shell_output.py
View file @
fefb3160
...
...
@@ -14,6 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
re
import
os
import
sys
from
lettuce.terrain
import
after
...
...
@@ -74,14 +75,33 @@ def print_end(total):
)
)
steps_details
=
[]
for
kind
in
(
"failed"
,
"skipped"
,
"undefined"
):
attr
=
'steps_
%
s'
%
kind
stotal
=
getattr
(
total
,
attr
)
if
stotal
:
steps_details
.
append
(
"
%
d
%
s"
%
(
stotal
,
kind
)
)
steps_details
.
append
(
"
%
d passed"
%
total
.
steps_passed
)
word
=
total
.
steps
>
1
and
"steps"
or
"step"
sys
.
stdout
.
write
(
"
%
d
%
s (
%
d passed
)
\n
"
%
(
sys
.
stdout
.
write
(
"
%
d
%
s (
%
s
)
\n
"
%
(
total
.
steps
,
word
,
total
.
steps_passed
", "
.
join
(
steps_details
)
)
)
if
total
.
proposed_definitions
:
sys
.
stdout
.
write
(
"
\n
You can implement step definitions for undefined steps with these snippets:
\n\n
"
)
sys
.
stdout
.
write
(
"from lettuce import step
\n\n
"
)
for
step
in
total
.
proposed_definitions
:
method_name
=
"_"
.
join
(
re
.
findall
(
"
\
w+"
,
step
.
sentence
))
.
lower
()
sys
.
stdout
.
write
(
"@step(r'
%
s')
\n
"
%
re
.
escape
(
step
.
sentence
)
.
replace
(
r'\ '
,
' '
))
sys
.
stdout
.
write
(
"def
%
s(step):
\n
"
%
method_name
)
sys
.
stdout
.
write
(
" pass
\n
"
)
def
print_no_features_found
(
where
):
where
=
os
.
path
.
relpath
(
where
)
if
not
where
.
startswith
(
os
.
sep
):
...
...
tests/functional/test_runner.py
View file @
fefb3160
...
...
@@ -402,9 +402,9 @@ def test_output_with_failed_colorless_with_table():
"
\033
[A And this one will be skipped # tests/functional/output_features/failed_table/failed_table_steps.py:28
\n
"
" And this one does not even has definition # tests/functional/output_features/failed_table/failed_table.feature:12 (undefined)
\n
"
"
\n
"
"1 feature (
1 fail
ed)
\n
"
"1 scenario (
1 fail
ed)
\n
"
"
4 steps (1 failed, 1
skipped, 1 undefined, 1 passed)
\n
"
"1 feature (
0 pass
ed)
\n
"
"1 scenario (
0 pass
ed)
\n
"
"
5 steps (1 failed, 2
skipped, 1 undefined, 1 passed)
\n
"
"
\n
"
"You can implement step definitions for undefined steps with these snippets:
\n
"
"
\n
"
...
...
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