def transform_checker(tests, transformer, **kwargs):
 transformer = transformer(**kwargs)
 try:
  for (inp, tr) in tests:
   if (inp is None):
    out = transformer.reset()
   else:
    out = transformer.push(inp)
   nt.assert_equal(out, tr)
 finally:
  transformer.reset()

def transform_checker ( tests , transformer , ** kwargs ) : transformer = transformer ( ** kwargs ) try : for ( inp , tr ) in tests : if ( inp is None ) : out = transformer . reset ( ) else : out = transformer . push ( inp ) nt . assert_equal ( out , tr ) finally : transformer . reset ( )
utility to loop over test inputs .