MCPcopy
hub / github.com/pallets-eco/flask-sqlalchemy / test_sqlite_relative_path

Function test_sqlite_relative_path

tests/test_engine.py:92–99  ·  view source on GitHub ↗
(app: Flask, model_class: t.Any)

Source from the content-addressed store, hash-verified

90
91@pytest.mark.usefixtures("app_ctx")
92def test_sqlite_relative_path(app: Flask, model_class: t.Any) -> None:
93 app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///test.db"
94 db = SQLAlchemy(app, model_class=model_class)
95 db.create_all()
96 assert not isinstance(db.engine.pool, sa.pool.StaticPool)
97 db_path = db.engine.url.database
98 assert db_path.startswith(app.instance_path) # type: ignore[union-attr]
99 assert os.path.exists(db_path) # type: ignore[arg-type]
100
101
102@pytest.mark.usefixtures("app_ctx")

Callers

nothing calls this directly

Calls 2

create_allMethod · 0.95
SQLAlchemyClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…