def step_runner_environ():
 from lettuce import registry
 registry.clear()
 @step('I have a defined step')
 def have_a_defined_step(*args, **kw):
  assert True
 @step('other step fails')
 def and_another(*args, **kw):
  assert False, 'It should fail'
 @step('define a step')
 def define_a_step(*args, **kw):
  assert True
 @step(u'When I have a step that raises an exception')
 def raises_exception(step):
  raise Exception()
 @step('I have a step which calls the "(.*)" step with behave_as')
 def runs_some_other_step_with_behave_as(step, something_else):
  step.behave_as(('When %(i_do_something_else)s' % {'i_do_something_else': something_else}))

def step_runner_environ ( ) : from lettuce import registry registry . clear ( ) @ step ( 'I have a defined step' ) def have_a_defined_step ( * args , ** kw ) : assert True @ step ( 'other step fails' ) def and_another ( * args , ** kw ) : assert False , 'It should fail' @ step ( 'define a step' ) def define_a_step ( * args , ** kw ) : assert True @ step ( u'When I have a step that raises an exception' ) def raises_exception ( step ) : raise Exception ( ) @ step ( 'I have a step which calls the "(.*)" step with behave_as' ) def runs_some_other_step_with_behave_as ( step , something_else ) : step . behave_as ( ( 'When %(i_do_something_else)s' % { 'i_do_something_else' : something_else } ) )
make sure the test environment is what is expected .