def after_scenario(context, _):
 if (hasattr(context, u'cli') and (not context.exit_sent)):
  context.cli.terminate()

def after_scenario ( context , _ ) : if ( hasattr ( context , u'cli' ) and ( not context . exit_sent ) ) : context . cli . terminate ( )
cleans up after each test complete .