Use db.table() and db.view() in tests, closes #838

This commit is contained in:
Simon Willison 2026-08-12 13:40:55 -07:00
commit 38fe466700
43 changed files with 1321 additions and 1254 deletions

View file

@ -11,8 +11,8 @@ def test_roundtrip_integers(integer):
row = {
"integer": integer,
}
db["test"].insert(row)
assert list(db["test"].rows) == [row]
db.table("test").insert(row)
assert list(db.table("test").rows) == [row]
@given(st.text())
@ -21,8 +21,8 @@ def test_roundtrip_text(text):
row = {
"text": text,
}
db["test"].insert(row)
assert list(db["test"].rows) == [row]
db.table("test").insert(row)
assert list(db.table("test").rows) == [row]
@given(st.binary(max_size=1024 * 1024))
@ -31,8 +31,8 @@ def test_roundtrip_binary(binary):
row = {
"binary": binary,
}
db["test"].insert(row)
assert list(db["test"].rows) == [row]
db.table("test").insert(row)
assert list(db.table("test").rows) == [row]
@given(st.floats(allow_nan=False))
@ -41,5 +41,5 @@ def test_roundtrip_floats(floats):
row = {
"floats": floats,
}
db["test"].insert(row)
assert list(db["test"].rows) == [row]
db.table("test").insert(row)
assert list(db.table("test").rows) == [row]