mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-27 20:34:12 +02:00
Test that exception is raised
This commit is contained in:
parent
2ded6545b4
commit
eb65270782
1 changed files with 9 additions and 0 deletions
|
|
@ -707,6 +707,15 @@ def test_insert_thousands_using_generator(fresh_db):
|
||||||
assert 10000 == fresh_db["test"].count
|
assert 10000 == fresh_db["test"].count
|
||||||
|
|
||||||
|
|
||||||
|
def test_insert_thousands_raises_exception_wtih_extra_columns_after_first_100(fresh_db):
|
||||||
|
# https://github.com/simonw/sqlite-utils/issues/139
|
||||||
|
with pytest.raises(Exception, match="table test has no column named extra"):
|
||||||
|
fresh_db["test"].insert_all(
|
||||||
|
[{"i": i, "word": "word_{}".format(i)} for i in range(100)]
|
||||||
|
+ [{"i": 101, "extra": "This extra column should cause an exception"}],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_insert_thousands_adds_extra_columns_after_first_100_with_alter(fresh_db):
|
def test_insert_thousands_adds_extra_columns_after_first_100_with_alter(fresh_db):
|
||||||
# https://github.com/simonw/sqlite-utils/issues/139
|
# https://github.com/simonw/sqlite-utils/issues/139
|
||||||
fresh_db["test"].insert_all(
|
fresh_db["test"].insert_all(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue