mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-29 04:14:32 +02:00
Use REAL for floating point columns if table is strict, closes #644
Refs #645
This commit is contained in:
parent
7423296ec7
commit
4dc2e2e9c8
4 changed files with 17 additions and 3 deletions
|
|
@ -1350,8 +1350,12 @@ def test_insert_upsert_strict(fresh_db, method_name, strict):
|
|||
|
||||
@pytest.mark.parametrize("strict", (False, True))
|
||||
def test_create_table_strict(fresh_db, strict):
|
||||
table = fresh_db.create_table("t", {"id": int}, strict=strict)
|
||||
table = fresh_db.create_table("t", {"id": int, "f": float}, strict=strict)
|
||||
assert table.strict == strict or not fresh_db.supports_strict
|
||||
expected_schema = "CREATE TABLE [t] (\n" " [id] INTEGER,\n" " [f] FLOAT\n" ")"
|
||||
if strict:
|
||||
expected_schema = "CREATE TABLE [t] (\n [id] INTEGER,\n [f] REAL\n) STRICT"
|
||||
assert table.schema == expected_schema
|
||||
|
||||
|
||||
@pytest.mark.parametrize("strict", (False, True))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue