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
503fe2d2
Commit
503fe2d2
authored
Oct 04, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tags applied to features are inherited by scenarios
parent
39f6118f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
lettuce/core.py
+1
-1
tests/unit/test_step_runner.py
+30
-1
No files found.
lettuce/core.py
View file @
503fe2d2
...
...
@@ -957,7 +957,7 @@ class Feature(object):
def
_add_myself_to_scenarios
(
self
):
for
scenario
in
self
.
scenarios
:
scenario
.
feature
=
self
if
scenario
.
tags
and
self
.
tags
:
if
scenario
.
tags
is
not
None
and
self
.
tags
:
scenario
.
tags
.
extend
(
self
.
tags
)
def
_find_tags_in
(
self
,
original_string
):
...
...
tests/unit/test_step_runner.py
View file @
503fe2d2
...
...
@@ -102,6 +102,18 @@ Feature: When using behave_as, the new steps have the same scenario
Given I have a step which calls the "access the scenario" step with behave_as
"""
FEATURE10
=
"""
@tag
Feature: Many scenarios
Scenario: 1st one
Given I have a defined step
Scenario: 2nd one
Given I have a defined step
"""
def
step_runner_environ
():
"Make sure the test environment is what is expected"
...
...
@@ -226,7 +238,7 @@ def test_steps_are_aware_of_its_definitions():
step1
=
scenario_result
.
steps_passed
[
0
]
assert_equals
(
step1
.
defined_at
.
line
,
1
12
)
assert_equals
(
step1
.
defined_at
.
line
,
1
24
)
assert_equals
(
step1
.
defined_at
.
file
,
core
.
fs
.
relpath
(
__file__
.
rstrip
(
"c"
)))
@with_setup
(
step_runner_environ
)
...
...
@@ -323,6 +335,23 @@ def test_feature_can_run_only_specified_scenarios_in_tags():
@with_setup
(
step_runner_environ
)
def
test_scenarios_inherit_feature_tags
():
"Tags applied to features are inherited by scenarios"
feature
=
Feature
.
from_string
(
FEATURE10
)
scenarios_ran
=
[]
@after.each_scenario
def
just_register
(
scenario
):
scenarios_ran
.
append
(
scenario
.
name
)
result
=
feature
.
run
(
tags
=
[
'tag'
])
assert
result
.
scenario_results
assert_equals
(
scenarios_ran
,
[
'1st one'
,
'2nd one'
])
@with_setup
(
step_runner_environ
)
def
test_count_raised_exceptions_as_failing_steps
():
"When a step definition raises an exception, it is marked as a failed step. "
...
...
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