MCPcopy Create free account
hub / github.com/Mause/duckdb_engine / test_config

Function test_config

duckdb_engine/tests/test_basic.py:479–496  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

477
478
479def test_config(tmp_path: Path) -> None:
480 db_path = tmp_path / "test.db"
481
482 db = duckdb.connect(str(db_path))
483 db.execute("create table hello1 (i int)")
484 db.close()
485
486 eng = create_engine(
487 f"duckdb:///{db_path}",
488 connect_args={"read_only": True, "config": {"memory_limit": "500mb"}},
489 )
490
491 with raises(
492 DBAPIError,
493 match='Cannot execute statement of type "CREATE" (on database "test" which is attached )?in read-only mode!',
494 ):
495 with eng.connect() as conn:
496 conn.execute(text("create table hello2 (i int)"))
497
498
499def test_url_config() -> None:

Callers

nothing calls this directly

Calls 3

connectMethod · 0.80
executeMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected