def test_real(func):
 @functools.wraps(func)
 def guard_func(*args, **kwargs):
  real = kwargs.pop('_test_real', None)
  if (not real):
   raise Exception('Forgot to mock or pass "_test_real=True" to %s', func.__name__)
  return func(*args, **kwargs)
 return guard_func

def test_real ( func ) : @ functools . wraps ( func ) def guard_func ( * args , ** kwargs ) : real = kwargs . pop ( '_test_real' , None ) if ( not real ) : raise Exception ( 'Forgot to mock or pass "_test_real=True" to %s' , func . __name__ ) return func ( * args , ** kwargs ) return guard_func
force a function to require a keyword _test_real to be passed in .