@contextmanager
def override_options(options):
 from django.conf import settings
 from sentry.options import default_manager
 wrapped = default_manager.store.get
 def new_get(key, **kwargs):
  try:
   return options[key.name]
  except KeyError:
   return wrapped(key, **kwargs)
 new_options = settings.SENTRY_OPTIONS.copy()
 new_options.update(options)
 with override_settings(SENTRY_OPTIONS=new_options):
  with patch.object(default_manager.store, 'get', side_effect=new_get):
   (yield)

@ contextmanager def override_options ( options ) : from django . conf import settings from sentry . options import default_manager wrapped = default_manager . store . get def new_get ( key , ** kwargs ) : try : return options [ key . name ] except KeyError : return wrapped ( key , ** kwargs ) new_options = settings . SENTRY_OPTIONS . copy ( ) new_options . update ( options ) with override_settings ( SENTRY_OPTIONS = new_options ) : with patch . object ( default_manager . store , 'get' , side_effect = new_get ) : ( yield )
a context manager for overriding specific configuration options .