(app: Flask, model_class: t.Any)
| 101 | |
| 102 | @pytest.mark.usefixtures("app_ctx") |
| 103 | def 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) |
nothing calls this directly
no test coverage detected
searching dependent graphs…