mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 00:54:19 +01:00
ext/python: Makes linter happy
This commit is contained in:
@@ -18,13 +18,16 @@ with limbo.connect("sqlite.db") as con:
|
||||
("alice", "alice@example.com", "admin"),
|
||||
("bob", "bob@example.com", "user"),
|
||||
("charlie", "charlie@example.com", "moderator"),
|
||||
("diana", "diana@example.com", "user")
|
||||
("diana", "diana@example.com", "user"),
|
||||
]
|
||||
for username, email, role in sample_users:
|
||||
cur.execute("""
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO users (username, email, role)
|
||||
VALUES (?, ?, ?)
|
||||
""", (username, email, role))
|
||||
""",
|
||||
(username, email, role),
|
||||
)
|
||||
|
||||
# Use commit to ensure the data is saved
|
||||
con.commit()
|
||||
|
||||
@@ -144,6 +144,7 @@ def test_commit(provider):
|
||||
conn.close()
|
||||
assert record
|
||||
|
||||
|
||||
@pytest.mark.parametrize("provider", ["sqlite3", "limbo"])
|
||||
def test_with_statement(provider):
|
||||
with connect(provider, "tests/database.db") as conn:
|
||||
@@ -156,6 +157,7 @@ def test_with_statement(provider):
|
||||
assert max_id
|
||||
assert max_id == (2,)
|
||||
|
||||
|
||||
def connect(provider, database):
|
||||
if provider == "limbo":
|
||||
return limbo.connect(database)
|
||||
|
||||
Reference in New Issue
Block a user