MCPcopy Index your code
hub / github.com/marimo-team/marimo / test_invalid_sql

Function test_invalid_sql

tests/_sql/test_sql.py:319–333  ·  view source on GitHub ↗
(
    sqlite_engine: sa.Engine, duckdb_connection: duckdb.DuckDBPyConnection
)

Source from the content-addressed store, hash-verified

317
318@pytest.mark.skipif(not HAS_SQLALCHEMY, reason="SQLAlchemy not installed")
319def 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

Callers

nothing calls this directly

Calls 1

sqlFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…