def skip_if_browser(browser):
 def decorator(test_function):
  @functools.wraps(test_function)
  def wrapper(self, *args, **kwargs):
   if (self.browser.name == browser):
    raise unittest.SkipTest('Skipping as this test will not work with {}'.format(browser))
   test_function(self, *args, **kwargs)
  return wrapper
 return decorator

def skip_if_browser ( browser ) : def decorator ( test_function ) : @ functools . wraps ( test_function ) def wrapper ( self , * args , ** kwargs ) : if ( self . browser . name == browser ) : raise unittest . SkipTest ( 'Skipping as this test will not work with {}' . format ( browser ) ) test_function ( self , * args , ** kwargs ) return wrapper return decorator
method decorator that skips a test if browser is browser args: browser : name of internet browser returns: decorated function .