def safe_setup(f):

    def decorator(cls):
        try:
            f(cls)
        except Exception as se:
            exc_info = sys.exc_info()
            LOG.exception("setUpClass failed: %s" % se)
            try:
                cls.tearDownClass()
            except Exception as te:
                LOG.exception("tearDownClass failed: %s" % te)
            six.reraise(*exc_info)

    return decorator
Returns whether the cursor could have rows returned
dataset/ETHPy150Open openstack/ec2-api/ec2api/tests/functional/base.py/safe_setup--crossover with--dataset/ETHPy150Open appnexus/schema-tool/schematool/mysql/connector/cursor.py/MySQLCursor.with_rows