Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pigletto committed Sep 6, 2011
1 parent 92f7b75 commit b344596
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions freshen/noseplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class FreshenNosePlugin(Plugin):
# This makes it so that freshen's formatFailure gets called before capture
# and logcapture - those plugins replace and obscure the true exception value
score = 1000
before_all_executed = False

def options(self, parser, env):
super(FreshenNosePlugin, self).options(parser, env)
Expand Down Expand Up @@ -267,7 +268,9 @@ def _formatSteps(self, test, failed_step, failure=True):
return "\n".join(ret)

def beforeTest(self, test):
run_all_hooks('before', test)
if not self.before_all_executed:
self.before_all_executed = True
run_all_hooks('before')

def afterTest(self, test):
run_all_hooks('after', test)
def finalize(self, test):
run_all_hooks('after')
4 changes: 2 additions & 2 deletions freshen/stepregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ def dec_after(f):
return f
return cb_type == 'before' and dec_before or dec_after

def run_all_hooks(cb_type, test):
def run_all_hooks(cb_type):
for f in all_steps[cb_type]:
f(test)
f()

def transform_decorator(spec_fragment):
def wrapper(func):
Expand Down

0 comments on commit b344596

Please sign in to comment.