def flaky(jira_keys, max_runs=3, min_passes=1):
 if isinstance(jira_keys, unicode):
  jira_keys = [jira_keys]
 annotation = _FlakyAnnotation(jira_keys=pset(jira_keys), max_runs=max_runs, min_passes=min_passes)
 def wrapper(test_method):
  existing_flaky = getattr(test_method, _FLAKY_ATTRIBUTE, None)
  if (existing_flaky is None):
   note = annotation
  else:
   note = _combine_flaky_annotation(annotation, existing_flaky)
  setattr(test_method, _FLAKY_ATTRIBUTE, note)
  return test_method
 return wrapper

def flaky ( jira_keys , max_runs = 3 , min_passes = 1 ) : if isinstance ( jira_keys , unicode ) : jira_keys = [ jira_keys ] annotation = _FlakyAnnotation ( jira_keys = pset ( jira_keys ) , max_runs = max_runs , min_passes = min_passes ) def wrapper ( test_method ) : existing_flaky = getattr ( test_method , _FLAKY_ATTRIBUTE , None ) if ( existing_flaky is None ) : note = annotation else : note = _combine_flaky_annotation ( annotation , existing_flaky ) setattr ( test_method , _FLAKY_ATTRIBUTE , note ) return test_method return wrapper
mark a test as flaky .