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

Function test_sqlite_driver_level_uri

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

Source from the content-addressed store, hash-verified

101
102@pytest.mark.usefixtures("app_ctx")
103def test_sqlite_driver_level_uri(app: Flask, model_class: t.Any) -> None:
104 app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///file:test.db?uri=true"
105 db = SQLAlchemy(app, model_class=model_class)
106 db.create_all()
107 db_path = db.engine.url.database
108 assert db_path is not None
109 assert db_path.startswith(f"file:{app.instance_path}")
110 assert os.path.exists(db_path[5:])
111
112
113@unittest.mock.patch.object(SQLAlchemy, "_make_engine", autospec=True)

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…