(
sqlite_engine: sa.Engine, duckdb_connection: duckdb.DuckDBPyConnection
)
| 317 | |
| 318 | @pytest.mark.skipif(not HAS_SQLALCHEMY, reason="SQLAlchemy not installed") |
| 319 | def test_invalid_sql( |
| 320 | sqlite_engine: sa.Engine, duckdb_connection: duckdb.DuckDBPyConnection |
| 321 | ) -> None: |
| 322 | import duckdb |
| 323 | import sqlalchemy |
| 324 | |
| 325 | from marimo._sql.error_utils import MarimoSQLException |
| 326 | |
| 327 | with pytest.raises(MarimoSQLException) as exc_info: |
| 328 | sql("SELECT *", engine=duckdb_connection) |
| 329 | assert isinstance(exc_info.value.__cause__, duckdb.Error) |
| 330 | |
| 331 | with pytest.raises(MarimoSQLException) as exc_info: |
| 332 | sql("SELECT *", engine=sqlite_engine) |
| 333 | assert isinstance(exc_info.value.__cause__, sqlalchemy.exc.StatementError) |
| 334 | |
| 335 | |
| 336 | # TODO |
nothing calls this directly
no test coverage detected
searching dependent graphs…