@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError@pytest.fixture(scope="module") def test_app(): > app = create_app() src/tests/conftest.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/__init__.py:23: in create_app db.init_app(app) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <SQLAlchemy>, app = <Flask 'src'> def init_app(self, app: Flask) -> None: """Initialize a Flask application for use with this extension instance. This must be called before accessing the database engine or session with the app. This sets default configuration values, then configures the extension on the application and creates the engines for each bind key. Therefore, this must be called after the application has been configured. Changes to application config after this call will not be reflected. The following keys from ``app.config`` are used: - :data:`.SQLALCHEMY_DATABASE_URI` - :data:`.SQLALCHEMY_ENGINE_OPTIONS` - :data:`.SQLALCHEMY_ECHO` - :data:`.SQLALCHEMY_BINDS` - :data:`.SQLALCHEMY_RECORD_QUERIES` - :data:`.SQLALCHEMY_TRACK_MODIFICATIONS` :param app: The Flask application to initialize. """ if "sqlalchemy" in app.extensions: raise RuntimeError( "A 'SQLAlchemy' instance has already been registered on this Flask app." " Import and use that instance instead." ) app.extensions["sqlalchemy"] = self if self._add_models_to_shell: from .cli import add_models_to_shell app.shell_context_processor(add_models_to_shell) if app.config.get("SQLALCHEMY_COMMIT_ON_TEARDOWN", False): import warnings warnings.warn( "'SQLALCHEMY_COMMIT_ON_TEARDOWN' is deprecated and will be removed in" " Flask-SQAlchemy 3.1. Call 'db.session.commit()'` directly instead.", DeprecationWarning, ) app.teardown_appcontext(self._teardown_commit) else: app.teardown_appcontext(self._teardown_session) basic_uri: str | sa.engine.URL | None = app.config.setdefault( "SQLALCHEMY_DATABASE_URI", None ) basic_engine_options = self._engine_options.copy() basic_engine_options.update( app.config.setdefault("SQLALCHEMY_ENGINE_OPTIONS", {}) ) echo: bool = app.config.setdefault("SQLALCHEMY_ECHO", False) config_binds: dict[ str | None, str | sa.engine.URL | dict[str, t.Any] ] = app.config.setdefault("SQLALCHEMY_BINDS", {}) engine_options: dict[str | None, dict[str, t.Any]] = {} # Build the engine config for each bind key. for key, value in config_binds.items(): engine_options[key] = self._engine_options.copy() if isinstance(value, (str, sa.engine.URL)): engine_options[key]["url"] = value else: engine_options[key].update(value) # Build the engine config for the default bind key. if basic_uri is not None: basic_engine_options["url"] = basic_uri if "url" in basic_engine_options: engine_options.setdefault(None, {}).update(basic_engine_options) if not engine_options: > raise RuntimeError( "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set." ) E RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. /home/slococo/.conda/envs/flights/lib/python3.11/site-packages/flask_sqlalchemy/extension.py:307: RuntimeError