def returns_None(function):
 def call_and_assert(*args, **kwargs):
  original_args = copy.deepcopy(args)
  original_kwargs = copy.deepcopy(kwargs)
  result = function(*args, **kwargs)
  assert (result is None), 'Should return None when called with args: {args} and kwargs: {kwargs}'.format(args=original_args, kwargs=original_kwargs)
  return result
 return call_and_assert

def returns_None ( function ) : def call_and_assert ( * args , ** kwargs ) : original_args = copy . deepcopy ( args ) original_kwargs = copy . deepcopy ( kwargs ) result = function ( * args , ** kwargs ) assert ( result is None ) , 'Should return None when called with args: {args} and kwargs: {kwargs}' . format ( args = original_args , kwargs = original_kwargs ) return result return call_and_assert
a decorator that asserts that the decorated function returns none .