Home | History | Annotate | Download | only in bluetooth

Lines Matching refs:test_method

292 def retry(test_method, instance, *args, **kwargs):
293 """Execute the target facade test_method(). Retry if failing the first time.
295 A test_method is something like self.test_xxxx() in BluetoothAdapterTests,
298 @param test_method: the test method to retry
300 @returns: True if the return value of test_method() is successful.
304 if _is_successful(_run_method(test_method, test_method.__name__,
309 logging.error('%s failed at the 1st time.', test_method.__name__)
313 logging.info('%s: retry the 2nd time.', test_method.__name__)
316 return _is_successful(_run_method(test_method, test_method.__name__,
324 logging.info('%s: retry the 2nd time.', test_method.__name__)
325 return _is_successful(_run_method(test_method, test_method.__name__,
333 @param test_method_or_retry_flag: either the test_method or a retry_flag.
335 1. the test_method to conduct and retry: should retry the test_method.
338 2. the retry flag is True. Should retry the test_method.
341 3. the retry flag is False. Do not retry the test_method.
345 @returns: a wrapper of the test_method with test log. The retry mechanism
350 def decorator(test_method):
351 """A decorator wrapper of the decorated test_method.
353 @param test_method: the test method being decorated.
358 @functools.wraps(test_method)
369 test_result = retry(test_method, instance, *args, **kwargs)
371 test_result = test_method(instance, *args, **kwargs)
374 logging.info('[*** passed: %s]', test_method.__name__)
376 fail_msg = '[--- failed: %s (%s)]' % (test_method.__name__,