@with_setup(prepare_stdout)
def test_output_background_with_success_colorless():
 from lettuce import step
 line = currentframe().f_lineno
 @step(u'the variable "(\\w+)" holds (\\d+)')
 @step(u'the variable "(\\w+)" is equal to (\\d+)')
 def just_pass(step, *args):
  pass
 filename = bg_feature_name('simple')
 runner = Runner(filename, verbosity=3, no_color=True)
 runner.run()
 assert_stdout_lines('\nFeature: Simple and successful                # tests/functional/bg_features/simple/simple.feature:1\n  As the Lettuce maintainer                   # tests/functional/bg_features/simple/simple.feature:2\n  In order to make sure the output is pretty  # tests/functional/bg_features/simple/simple.feature:3\n  I want to automate its test                 # tests/functional/bg_features/simple/simple.feature:4\n\n  Background:\n    Given the variable "X" holds 2            # tests/functional/test_runner.py:{line}\n\n  Scenario: multiplication changing the value # tests/functional/bg_features/simple/simple.feature:9\n    Given the variable "X" is equal to 2      # tests/functional/test_runner.py:{line}\n\n1 feature (1 passed)\n1 scenario (1 passed)\n1 step (1 passed)\n'.format(line=(line + 2)))

@ with_setup ( prepare_stdout ) def test_output_background_with_success_colorless ( ) : from lettuce import step line = currentframe ( ) . f_lineno @ step ( u'the variable "(\\w+)" holds (\\d+)' ) @ step ( u'the variable "(\\w+)" is equal to (\\d+)' ) def just_pass ( step , * args ) : pass filename = bg_feature_name ( 'simple' ) runner = Runner ( filename , verbosity = 3 , no_color = True ) runner . run ( ) assert_stdout_lines ( '\nFeature: Simple and successful                # tests/functional/bg_features/simple/simple.feature:1\n  As the Lettuce maintainer                   # tests/functional/bg_features/simple/simple.feature:2\n  In order to make sure the output is pretty  # tests/functional/bg_features/simple/simple.feature:3\n  I want to automate its test                 # tests/functional/bg_features/simple/simple.feature:4\n\n  Background:\n    Given the variable "X" holds 2            # tests/functional/test_runner.py:{line}\n\n  Scenario: multiplication changing the value # tests/functional/bg_features/simple/simple.feature:9\n    Given the variable "X" is equal to 2      # tests/functional/test_runner.py:{line}\n\n1 feature (1 passed)\n1 scenario (1 passed)\n1 step (1 passed)\n' . format ( line = ( line + 2 ) ) )
a feature with background should print it accordingly under verbosity 3 .