mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-30 14:06:00 +02:00
TransformError() on strict=True if SQLite does not suppor strict
Refs https://github.com/simonw/sqlite-utils/pull/788#issuecomment-4948479356
This commit is contained in:
parent
5b9898ed9b
commit
b73e0e1021
5 changed files with 18 additions and 2 deletions
|
|
@ -615,6 +615,18 @@ def test_transform_strict_updates_default(fresh_db):
|
|||
assert table.strict is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize("method_name", ("transform", "transform_sql"))
|
||||
def test_transform_to_strict_not_supported(fresh_db, method_name):
|
||||
table = fresh_db["items"]
|
||||
table.create({"id": int})
|
||||
fresh_db._supports_strict = False
|
||||
|
||||
with pytest.raises(TransformError, match="SQLite does not support STRICT tables"):
|
||||
getattr(table, method_name)(strict=True)
|
||||
|
||||
assert table.strict is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"indexes, transform_params",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue