@staticmethod
  def _teardown_handler(session, app, session_options):
    try:
      if session_options['commit']:
        session.commit()
    except (DBAPIError, SQLAlchemyError) as err:
      if session_options['raise']:
        raise err
      session.rollback()
    finally:
      session.remove()
Static method to allow overriding without passing first argument.
dataset/ETHPy150Open mtth/kit/kit/base.py/Kit._teardown_handler