@with_setup(prepare_stdout)
def test_background_with_header():
 from lettuce import step, world
 @step(u'the variable "(\\w+)" holds (\\d+)')
 def set_variable(step, name, value):
  setattr(world, name, int(value))
 @step(u'the variable "(\\w+)" is equal to (\\d+)')
 def check_variable(step, name, expected):
  expected = int(expected)
  expect(world).to.have.property(name).being.equal(expected)
 @step(u'the variable "(\\w+)" times (\\d+) is equal to (\\d+)')
 def multiply_and_verify(step, name, times, expected):
  times = int(times)
  expected = int(expected)
  (getattr(world, name) * times).should.equal(expected)
 filename = bg_feature_name('header')
 runner = Runner(filename, verbosity=1)
 runner.run()
 assert_stdout_lines('..\n1 feature (1 passed)\n2 scenarios (2 passed)\n7 steps (7 passed)\n')

@ with_setup ( prepare_stdout ) def test_background_with_header ( ) : from lettuce import step , world @ step ( u'the variable "(\\w+)" holds (\\d+)' ) def set_variable ( step , name , value ) : setattr ( world , name , int ( value ) ) @ step ( u'the variable "(\\w+)" is equal to (\\d+)' ) def check_variable ( step , name , expected ) : expected = int ( expected ) expect ( world ) . to . have . property ( name ) . being . equal ( expected ) @ step ( u'the variable "(\\w+)" times (\\d+) is equal to (\\d+)' ) def multiply_and_verify ( step , name , times , expected ) : times = int ( times ) expected = int ( expected ) ( getattr ( world , name ) * times ) . should . equal ( expected ) filename = bg_feature_name ( 'header' ) runner = Runner ( filename , verbosity = 1 ) runner . run ( ) assert_stdout_lines ( '..\n1 feature (1 passed)\n2 scenarios (2 passed)\n7 steps (7 passed)\n' )
running background with header .