def for_dtypes(dtypes, name='dtype'):
 def decorator(impl):
  @functools.wraps(impl)
  def test_func(self, *args, **kw):
   for dtype in dtypes:
    try:
     kw[name] = dtype
     impl(self, *args, **kw)
    except Exception:
     print(name, 'is', dtype)
     raise
  return test_func
 return decorator

def for_dtypes ( dtypes , name = 'dtype' ) : def decorator ( impl ) : @ functools . wraps ( impl ) def test_func ( self , * args , ** kw ) : for dtype in dtypes : try : kw [ name ] = dtype impl ( self , * args , ** kw ) except Exception : print ( name , 'is' , dtype ) raise return test_func return decorator
decorator for parameterized dtype test .