This commit is contained in:
ikatyal2110 2026-10-11 05:30:26 -07:00 • committed by GitHub
commit 28a85f8afc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 2 deletions

View file

@ -1,4 +1,6 @@
import pytest
import sqlite_utils
from sqlite_utils.db import NoTable
def test_delete_rowid_table(fresh_db):
@ -62,3 +64,8 @@ def test_delete_where_analyze(fresh_db):
assert list(fresh_db.table("sqlite_stat1").rows) == [
{"tbl": "table", "idx": "idx_table_i", "stat": "6 1"}
]
def test_delete_where_nonexistent_table(fresh_db):
with pytest.raises(NoTable):
fresh_db.table("does_not_exist").delete_where()

View file

@ -147,3 +147,9 @@ def test_pks_and_rows_where_compound_pk_declaration_order(fresh_db):
fresh_db.table("t").insert({"a": "A", "b": "B"})
pks_and_rows = list(fresh_db.table("t").pks_and_rows_where())
assert pks_and_rows == [(("A", "B"), {"b": "B", "a": "A"})]
def test_rows_where_nonexistent_table_raises(fresh_db):
from sqlite_utils.db import NoTable
with pytest.raises(NoTable):
list(fresh_db.table("does_not_exist").rows_where())