old_contents: import pytest
  from flask import current_app
  
  from labelingbot import create_app
  
  
  @pytest.fixture
  def app():
      app = create_app('testing')
      return app
  
  
  def test_app_exists():
      assert current_app is not None
  
new_contents: import pytest
  
  from labelingbot import create_app
  from labelingbot import db as _db
  
  
  @pytest.fixture(scope='session')
  def app():
      app = create_app('testing')
      app_context = app.app_context()
      app_context.push()
  
      yield app
  
      app_context.pop()
  
  
  @pytest.fixture(scope='session')
  def db(app, request):
      _db.app = app
      _db.create_all()
  
      yield _db
  
      _db.drop_all()
  
  
  @pytest.fixture(scope='function')
  def session(db, request):
      connection = db.engine.connect()
      transaction = connection.begin()
  
      session = db.create_scoped_session(
          options={
              "bind": connection,
              "binds": {}
          }
      )
  
      db.session = session
  
      yield session
  
      transaction.rollback()
      connection.close()
      session.remove()
  
subject: Add db, session fixtures