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
2f7d20b0
Commit
2f7d20b0
authored
Jan 28, 2013
by
Gabriel Falcao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only calling @before.all if there are features. closes #315
parent
b44e11b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
lettuce/__init__.py
+2
-2
tests/integration/test_couves.py
+15
-2
No files found.
lettuce/__init__.py
View file @
2f7d20b0
...
@@ -133,8 +133,6 @@ class Runner(object):
...
@@ -133,8 +133,6 @@ class Runner(object):
print
"Error loading step definitions:
\n
"
,
e
print
"Error loading step definitions:
\n
"
,
e
return
return
call_hook
(
'before'
,
'all'
)
results
=
[]
results
=
[]
if
self
.
single_feature
:
if
self
.
single_feature
:
features_files
=
[
self
.
single_feature
]
features_files
=
[
self
.
single_feature
]
...
@@ -147,6 +145,8 @@ class Runner(object):
...
@@ -147,6 +145,8 @@ class Runner(object):
self
.
output
.
print_no_features_found
(
self
.
loader
.
base_dir
)
self
.
output
.
print_no_features_found
(
self
.
loader
.
base_dir
)
return
return
call_hook
(
'before'
,
'all'
)
failed
=
False
failed
=
False
try
:
try
:
for
filename
in
features_files
:
for
filename
in
features_files
:
...
...
tests/integration/test_couves.py
View file @
2f7d20b0
...
@@ -16,9 +16,11 @@
...
@@ -16,9 +16,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
commands
import
commands
from
lettuce.fs
import
FileSystem
from
lettuce.fs
import
FileSystem
from
sure
import
expect
current_directory
=
FileSystem
.
dirname
(
__file__
)
current_directory
=
FileSystem
.
dirname
(
__file__
)
def
test_django_agains_couves
():
def
test_django_agains_couves
():
'it always call @after.all hooks, even after exceptions'
'it always call @after.all hooks, even after exceptions'
...
@@ -26,7 +28,18 @@ def test_django_agains_couves():
...
@@ -26,7 +28,18 @@ def test_django_agains_couves():
status
,
out
=
commands
.
getstatusoutput
(
"python manage.py harvest --verbosity=3"
)
status
,
out
=
commands
.
getstatusoutput
(
"python manage.py harvest --verbosity=3"
)
assert
"Couves before all"
in
out
expect
(
"Couves before all"
)
.
to
.
be
.
within
(
out
)
assert
"Couves after all"
in
out
expect
(
"Couves after all"
)
.
to
.
be
.
within
(
out
)
FileSystem
.
popd
()
FileSystem
.
popd
()
def
test_django_agains_couves_nohooks
():
'it only calls @before.all and @after.all hooks if there are features found'
FileSystem
.
pushd
(
current_directory
,
"django"
,
"couves"
)
status
,
out
=
commands
.
getstatusoutput
(
"python manage.py harvest --verbosity=3 --tags=nothingwillbefound"
)
expect
(
"Couves before all"
)
.
to
.
not_be
.
within
(
out
)
expect
(
"Couves after all"
)
.
to
.
not_be
.
within
(
out
)
FileSystem
.
popd
()
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