def onlyPy2(test):
 @functools.wraps(test)
 def wrapper(*args, **kwargs):
  msg = '{name} requires Python 2.x to run'.format(name=test.__name__)
  if six.PY3:
   raise SkipTest(msg)
  return test(*args, **kwargs)
 return wrapper

def onlyPy2 ( test ) : @ functools . wraps ( test ) def wrapper ( * args , ** kwargs ) : msg = '{name} requires Python 2.x to run' . format ( name = test . __name__ ) if six . PY3 : raise SkipTest ( msg ) return test ( * args , ** kwargs ) return wrapper
skips this test unless you are on python 2 .