mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-11-20 17:09:46 +01:00
Use db.table() and db.view() in tests, closes #838
This commit is contained in:
parent
43d5d3331f
commit
38fe466700
43 changed files with 1321 additions and 1254 deletions
|
|
@ -112,7 +112,7 @@ def test_mutator_commits_by_default(tmp_path, mutate, expected_rows):
|
|||
db = seed_database(path)
|
||||
|
||||
assert not db.conn.in_transaction
|
||||
mutate(db["items"])
|
||||
mutate(db.table("items"))
|
||||
assert current_rows(db) == expected_rows
|
||||
assert not db.conn.in_transaction
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ def test_mutator_commits_with_outer_atomic(tmp_path, mutate, expected_rows):
|
|||
|
||||
with db.atomic():
|
||||
assert db.conn.in_transaction
|
||||
mutate(db["items"])
|
||||
mutate(db.table("items"))
|
||||
assert current_rows(db) == expected_rows
|
||||
assert db.conn.in_transaction
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ def test_mutator_rolls_back_outer_atomic(tmp_path, mutate, expected_rows):
|
|||
db = seed_database(path)
|
||||
|
||||
with pytest.raises(RollbackTest), db.atomic():
|
||||
mutate(db["items"])
|
||||
mutate(db.table("items"))
|
||||
assert current_rows(db) == expected_rows
|
||||
assert db.conn.in_transaction
|
||||
raise RollbackTest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue