@with_setup(step_runner_environ)
def test_can_figure_out_why_has_failed():
 f = Feature.from_string(FEATURE1)
 feature_result = f.run()
 scenario_result = feature_result.scenario_results[0]
 failed_step = scenario_result.steps_failed[0]
 assert_equals(failed_step.why.cause, 'It should fail')
 assert ('Traceback (most recent call last):' in failed_step.why.traceback)
 assert ('AssertionError: It should fail' in failed_step.why.traceback)
 assert_equals(type(failed_step.why.exception), AssertionError)

@ with_setup ( step_runner_environ ) def test_can_figure_out_why_has_failed ( ) : f = Feature . from_string ( FEATURE1 ) feature_result = f . run ( ) scenario_result = feature_result . scenario_results [ 0 ] failed_step = scenario_result . steps_failed [ 0 ] assert_equals ( failed_step . why . cause , 'It should fail' ) assert ( 'Traceback (most recent call last):' in failed_step . why . traceback ) assert ( 'AssertionError: It should fail' in failed_step . why . traceback ) assert_equals ( type ( failed_step . why . exception ) , AssertionError )
it can figure out why the test has failed .