def generator(f):
 @processor
 def new_func(stream, *args, **kwargs):
  for item in stream:
   (yield item)
  for item in f(*args, **kwargs):
   (yield item)
 return update_wrapper(new_func, f)

def generator ( f ) : @ processor def new_func ( stream , * args , ** kwargs ) : for item in stream : ( yield item ) for item in f ( * args , ** kwargs ) : ( yield item ) return update_wrapper ( new_func , f )
generate tests from test strings .