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
a23cbb33
Commit
a23cbb33
authored
Sep 28, 2010
by
Andres Jaan Tack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a line break between scenarios, making the output a little nicer to look at.
parent
f20baea0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
4 deletions
+74
-4
lettuce/plugins/colored_shell_output.py
+1
-3
lettuce/plugins/shell_output.py
+1
-1
tests/functional/output_features/many_successful_scenarios/dumb_steps.py
+8
-0
tests/functional/output_features/many_successful_scenarios/first.feature
+10
-0
tests/functional/test_runner.py
+54
-0
No files found.
lettuce/plugins/colored_shell_output.py
View file @
a23cbb33
...
...
@@ -114,7 +114,7 @@ def print_step_ran(step):
def
print_scenario_running
(
scenario
):
string
=
scenario
.
represented
()
string
=
wrap_file_and_line
(
string
,
'
\033
[1;30m'
,
'
\033
[0m'
)
write_out
(
"
\033
[1;37m
%
s"
%
string
)
write_out
(
"
\
n\
033
[1;37m
%
s"
%
string
)
@after.outline
def
print_outline
(
scenario
,
order
,
outline
,
reasons_to_fail
):
...
...
@@ -152,8 +152,6 @@ def print_feature_running(feature):
line
=
wrap_file_and_line
(
line
,
'
\033
[1;30m'
,
'
\033
[0m'
)
write_out
(
"
\033
[1;37m
%
s
\n
"
%
line
)
write_out
(
"
\n
"
)
@after.all
def
print_end
(
total
):
write_out
(
"
\n
"
)
...
...
lettuce/plugins/shell_output.py
View file @
a23cbb33
...
...
@@ -56,6 +56,7 @@ def print_step_ran(step):
@before.each_scenario
def
print_scenario_running
(
scenario
):
wrt
(
'
\n
'
)
wrt
(
scenario
.
represented
())
@after.outline
...
...
@@ -82,7 +83,6 @@ def print_outline(scenario, order, outline, reasons_to_fail):
def
print_feature_running
(
feature
):
wrt
(
"
\n
"
)
wrt
(
feature
.
represented
())
wrt
(
"
\n
"
)
@after.all
def
print_end
(
total
):
...
...
tests/functional/output_features/many_successful_scenarios/dumb_steps.py
0 → 100644
View file @
a23cbb33
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from
lettuce
import
step
@step
(
'Given I do nothing'
)
def
do_nothing
(
step
):
pass
@step
(
'Then I see that the test passes'
)
def
see_test_passes
(
step
):
pass
tests/functional/output_features/many_successful_scenarios/first.feature
0 → 100644
View file @
a23cbb33
Feature
:
Dumb feature
In order to test success
As a programmer
I want to see that the output is green
Scenario
:
Do
nothing
Given
I do nothing
Scenario
:
Do
nothing (again)
Given
I do nothing (again)
tests/functional/test_runner.py
View file @
a23cbb33
...
...
@@ -159,6 +159,33 @@ def test_output_with_success_colorless():
)
@with_setup
(
prepare_stdout
)
def
test_output_with_success_colorless
():
"A feature with two scenarios should separate the two scenarios with a new line (in colorless mode)."
runner
=
Runner
(
join
(
abspath
(
dirname
(
__file__
)),
'output_features'
,
'many_successful_scenarios'
),
verbosity
=
3
)
runner
.
run
()
assert_stdout_lines
(
"
\n
"
"Feature: Dumb feature # tests/functional/output_features/many_successful_scenarios/first.feature:1
\n
"
" In order to test success # tests/functional/output_features/many_successful_scenarios/first.feature:2
\n
"
" As a programmer # tests/functional/output_features/many_successful_scenarios/first.feature:3
\n
"
" I want to see that the output is green # tests/functional/output_features/many_successful_scenarios/first.feature:4
\n
"
"
\n
"
" Scenario: Do nothing # tests/functional/output_features/many_successful_scenarios/first.feature:6
\n
"
" Given I do nothing # tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\n
"
"
\033
[A Given I do nothing # tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\n
"
"
\n
"
" Scenario: Do nothing (again) # tests/functional/output_features/many_successful_scenarios/first.feature:9
\n
"
" Given I do nothing (again) # tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\n
"
"
\033
[A Given I do nothing (again) # tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\n
"
"
\n
"
"1 feature (1 passed)
\n
"
"2 scenarios (2 passed)
\n
"
"2 steps (2 passed)
\n
"
)
@with_setup
(
prepare_stdout
)
def
test_output_with_success_colorful
():
"Testing the output of a successful feature"
...
...
@@ -182,6 +209,33 @@ def test_output_with_success_colorful():
)
@with_setup
(
prepare_stdout
)
def
test_output_with_success_colorful
():
"A feature with two scenarios should separate the two scenarios with a new line (in color mode)."
runner
=
Runner
(
join
(
abspath
(
dirname
(
__file__
)),
'output_features'
,
'many_successful_scenarios'
),
verbosity
=
4
)
runner
.
run
()
assert_stdout_lines
(
"
\n
"
\
"
\033
[1;37mFeature: Dumb feature
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/first.feature:1
\033
[0m
\n
"
\
"
\033
[1;37m In order to test success
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/first.feature:2
\033
[0m
\n
"
\
"
\033
[1;37m As a programmer
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/first.feature:3
\033
[0m
\n
"
\
"
\033
[1;37m I want to see that the output is green
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/first.feature:4
\033
[0m
\n
"
\
"
\n
"
\
"
\033
[1;37m Scenario: Do nothing
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/first.feature:6
\033
[0m
\n
"
\
"
\033
[1;30m Given I do nothing
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\033
[0m
\n
"
\
"
\033
[A
\033
[1;32m Given I do nothing
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\033
[0m
\n
"
\
"
\n
"
\
"
\033
[1;37m Scenario: Do nothing (again)
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/first.feature:9
\033
[0m
\n
"
\
"
\033
[1;30m Given I do nothing (again)
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\033
[0m
\n
"
\
"
\033
[A
\033
[1;32m Given I do nothing (again)
\033
[1;30m# tests/functional/output_features/many_successful_scenarios/dumb_steps.py:6
\033
[0m
\n
"
\
"
\n
"
\
"
\033
[1;37m1 feature (
\033
[1;32m1 passed
\033
[1;37m)
\033
[0m
\n
"
\
"
\033
[1;37m2 scenarios (
\033
[1;32m2 passed
\033
[1;37m)
\033
[0m
\n
"
\
"
\033
[1;37m2 steps (
\033
[1;32m2 passed
\033
[1;37m)
\033
[0m
\n
"
)
@with_setup
(
prepare_stdout
)
def
test_output_with_success_colorless_many_features
():
"Testing the output of many successful features"
runner
=
Runner
(
join
(
abspath
(
dirname
(
__file__
)),
'output_features'
,
'many_successful_features'
),
verbosity
=
3
)
...
...
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