def dataProvider(fn_data_provider):
 def test_decorator(test_method):
  def execute_test_method_with_each_data_set(self):
   for data in fn_data_provider():
    if ((len(data) == 2) and isinstance(data[0], tuple) and isinstance(data[1], dict)):
     (args, kwargs) = data[:]
    else:
     (args, kwargs) = (data, {})
    try:
     test_method(self, *args, **kwargs)
    except AssertionError as e:
     self.fail(('%s (Provided data: %s, %s)' % (e, args, kwargs)))
  return execute_test_method_with_each_data_set
 return test_decorator

def dataProvider ( fn_data_provider ) : def test_decorator ( test_method ) : def execute_test_method_with_each_data_set ( self ) : for data in fn_data_provider ( ) : if ( ( len ( data ) == 2 ) and isinstance ( data [ 0 ] , tuple ) and isinstance ( data [ 1 ] , dict ) ) : ( args , kwargs ) = data [ : ] else : ( args , kwargs ) = ( data , { } ) try : test_method ( self , * args , ** kwargs ) except AssertionError as e : self . fail ( ( '%s (Provided data: %s, %s)' % ( e , args , kwargs ) ) ) return execute_test_method_with_each_data_set return test_decorator
data provider decorator .