def set_extra_environ(key, value):
 def decorator(func):
  def wrapper(*args, **kwargs):
   app = _get_test_app()
   app.get('/', extra_environ={key: value})
   try:
    return_value = func(*args, **kwargs)
   finally:
    app.get('/', extra_environ={key: ''})
   return return_value
  return nose.tools.make_decorator(func)(wrapper)
 return decorator

def set_extra_environ ( key , value ) : def decorator ( func ) : def wrapper ( * args , ** kwargs ) : app = _get_test_app ( ) app . get ( '/' , extra_environ = { key : value } ) try : return_value = func ( * args , ** kwargs ) finally : app . get ( '/' , extra_environ = { key : '' } ) return return_value return nose . tools . make_decorator ( func ) ( wrapper ) return decorator
decorator to temporarily changes a single request environemnt value create a new test app and use the a side effect of making a request to set an extra_environ value .