diff --git a/.gitignore b/.gitignore
index 6d2bd58..628a4dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@
.env.*
!.env.dev.example
!.env.prod.example
-node_modules
\ No newline at end of file
+node_modules
+*.xml
\ No newline at end of file
diff --git a/auth-domain/user-manager/coverage.xml b/auth-domain/user-manager/coverage.xml
deleted file mode 100644
index 0879bbc..0000000
--- a/auth-domain/user-manager/coverage.xml
+++ /dev/null
@@ -1,454 +0,0 @@
-
-
-
-
-
- /home/slococo/ITBA/MICRO/fids/auth-domain/user-manager/src
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/auth-domain/user-manager/report.xml b/auth-domain/user-manager/report.xml
deleted file mode 100644
index 99dea1d..0000000
--- a/auth-domain/user-manager/report.xml
+++ /dev/null
@@ -1,4693 +0,0 @@
-@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
\ No newline at end of file
diff --git a/gateway/src/tests/pytest.ini b/gateway/src/tests/pytest.ini
new file mode 100644
index 0000000..e69de29
diff --git a/run.sh b/run.sh
index bd6460f..151e62a 100755
--- a/run.sh
+++ b/run.sh
@@ -1,27 +1,144 @@
-#!/bin/bash
+#!/usr/bin/env bash
-export USER_MANAGER=auth-domain/user-manager
-docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.prod -t $USER/user-manager:prod
-export FLIGHTS_INFORMATION=flights-domain/flights-information
-docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.prod -t $USER/flights-information:prod
-docker build gateway -f gateway/Dockerfile.prod -t $USER/gateway:prod
+usage() {
+ printf "$0 usage: \n -x: down\n -d \$DOMAIN: domain\n -t: tests\n" $0
+ exit 0
+}
-docker build screen-domain -f screen-domain/Dockerfile.prod -t $USER/screen-client:prod
-docker build browser-domain -f browser-domain/Dockerfile.prod -t $USER/browser-client:prod
+domain=
+down=
+tests=
-export API_IMAGE=$USER/flights-information:prod
-docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
-docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod up -d
-export API_IMAGE=$USER/user-manager:prod
-docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
-docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod up -d
-docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py recreate_db
-docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py seed_db
-export API_IMAGE=$USER/gateway:prod
-docker compose -f gateway/docker-compose.yml down
-docker compose -f gateway/docker-compose.yml up -d
+while getopts ":hd:xt" arg; do
+ case $arg in
+ x) down=Y ;;
+ d) domain=${OPTARG} ;;
+ t) tests=Y ;;
+ h | *) usage ;;
+ esac
+done
-export CLIENT_IMAGE=$USER/screen-client:prod
-docker compose -f screen-domain/docker-compose.yml up -d
-export CLIENT_IMAGE=$USER/browser-client:prod
-docker compose -f browser-domain/docker-compose.yml up -d
+if [ -n "$domain" ] && [ -n "$down" ]; then
+ case "$domain" in
+ 'auth')
+ export API_IMAGE=$USER/user-manager:prod
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
+ ;;
+ 'flights')
+ export API_IMAGE=$USER/flights-information:prod
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
+ ;;
+ 'gateway')
+ export API_IMAGE=$USER/gateway:prod
+ docker compose -f gateway/docker-compose.yml down
+ ;;
+ 'screen')
+ export CLIENT_IMAGE=$USER/screen-client:prod
+ docker compose -f screen-domain/docker-compose.yml down
+ ;;
+ 'browser')
+ export CLIENT_IMAGE=$USER/browser-client:prod
+ docker compose -f browser-domain/docker-compose.yml down
+ ;;
+ *) exit 1 ;;
+ esac
+elif [ -n "$domain" ] && [ -z "$down" ]; then
+ case "$domain" in
+ 'auth')
+ export USER_MANAGER=auth-domain/user-manager
+ docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.prod -t $USER/user-manager:prod
+
+ if [ -n "$tests" ]; then
+ docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.test --build-arg "BASE_IMAGE=$USER/user-manager:prod" -t $USER/user-manager:test
+ export API_IMAGE=$USER/user-manager:test
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.dev up --abort-on-container-exit
+ else
+ export API_IMAGE=$USER/user-manager:prod
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod up -d
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py recreate_db
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py seed_db
+ fi
+ ;;
+ 'flights')
+ export FLIGHTS_INFORMATION=flights-domain/flights-information
+ docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.prod -t $USER/flights-information:prod
+
+ if [ -n "$tests" ]; then
+ docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.test --build-arg "BASE_IMAGE=$USER/flights-information:prod" -t $USER/flights-information:test
+ export API_IMAGE=$USER/flights-information:test
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.dev down
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.dev up --abort-on-container-exit
+ else
+ export API_IMAGE=$USER/flights-information:prod
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod up -d
+ fi
+
+ ;;
+ 'gateway')
+ docker build gateway -f gateway/Dockerfile.prod -t $USER/gateway:prod
+
+ if [ -n "$tests" ]; then
+ docker build gateway -f gateway/Dockerfile.test --build-arg "BASE_IMAGE=$USER/gateway:prod" -t $USER/gateway:test
+ export API_IMAGE=$USER/gateway:test
+ docker compose -f gateway/docker-compose.yml down
+ docker compose -f gateway/docker-compose.yml up -d
+ else
+ export API_IMAGE=$USER/gateway:prod
+ docker compose -f gateway/docker-compose.yml down
+ docker compose -f gateway/docker-compose.yml up -d
+ fi
+ ;;
+ 'screen')
+ docker build screen-domain -f screen-domain/Dockerfile.prod -t $USER/screen-client:prod
+ export CLIENT_IMAGE=$USER/screen-client:prod
+ docker compose -f screen-domain/docker-compose.yml up -d
+ ;;
+ 'browser')
+ docker build browser-domain -f browser-domain/Dockerfile.prod -t $USER/browser-client:prod
+ export CLIENT_IMAGE=$USER/browser-client:prod
+ docker compose -f browser-domain/docker-compose.yml up -d
+ ;;
+ *) exit 1 ;;
+ esac
+elif [ -n "$down" ]; then
+ export API_IMAGE=$USER/flights-information:prod
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
+ export API_IMAGE=$USER/user-manager:prod
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
+ export API_IMAGE=$USER/gateway:prod
+ docker compose -f gateway/docker-compose.yml down
+
+ export CLIENT_IMAGE=$USER/screen-client:prod
+ docker compose -f screen-domain/docker-compose.yml down
+ export CLIENT_IMAGE=$USER/browser-client:prod
+ docker compose -f browser-domain/docker-compose.yml down
+else
+ export USER_MANAGER=auth-domain/user-manager
+ docker build $USER_MANAGER -f $USER_MANAGER/Dockerfile.prod -t $USER/user-manager:prod
+ export FLIGHTS_INFORMATION=flights-domain/flights-information
+ docker build $FLIGHTS_INFORMATION -f $FLIGHTS_INFORMATION/Dockerfile.prod -t $USER/flights-information:prod
+ docker build gateway -f gateway/Dockerfile.prod -t $USER/gateway:prod
+
+ docker build screen-domain -f screen-domain/Dockerfile.prod -t $USER/screen-client:prod
+ docker build browser-domain -f browser-domain/Dockerfile.prod -t $USER/browser-client:prod
+
+ export API_IMAGE=$USER/flights-information:prod
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod down
+ docker compose -f flights-domain/docker-compose.yml --env-file flights-domain/.env.prod up -d
+ export API_IMAGE=$USER/user-manager:prod
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod down
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod up -d
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py recreate_db
+ docker compose -f auth-domain/docker-compose.yml --env-file auth-domain/.env.prod exec usermanager-api python manage.py seed_db
+ export API_IMAGE=$USER/gateway:prod
+ docker compose -f gateway/docker-compose.yml down
+ docker compose -f gateway/docker-compose.yml up -d
+
+ export CLIENT_IMAGE=$USER/screen-client:prod
+ docker compose -f screen-domain/docker-compose.yml up -d
+ export CLIENT_IMAGE=$USER/browser-client:prod
+ docker compose -f browser-domain/docker-compose.yml up -d
+fi
\ No newline at end of file