From 6edf3dd3b1a810b89ee0202a65a595599a8c00cd Mon Sep 17 00:00:00 2001 From: Diego Reis Date: Mon, 24 Mar 2025 12:40:59 -0300 Subject: [PATCH] ext/python: Makes linter happy --- bindings/python/example.py | 17 ++++++++++------- bindings/python/tests/test_database.py | 6 ++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bindings/python/example.py b/bindings/python/example.py index 2a687f68f..870766e8f 100644 --- a/bindings/python/example.py +++ b/bindings/python/example.py @@ -15,16 +15,19 @@ with limbo.connect("sqlite.db") as con: # Insert some sample data sample_users = [ - ("alice", "alice@example.com", "admin"), - ("bob", "bob@example.com", "user"), - ("charlie", "charlie@example.com", "moderator"), - ("diana", "diana@example.com", "user") - ] + ("alice", "alice@example.com", "admin"), + ("bob", "bob@example.com", "user"), + ("charlie", "charlie@example.com", "moderator"), + ("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() diff --git a/bindings/python/tests/test_database.py b/bindings/python/tests/test_database.py index 1f1ef7243..c5f1e7678 100644 --- a/bindings/python/tests/test_database.py +++ b/bindings/python/tests/test_database.py @@ -144,18 +144,20 @@ 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: conn = connect(provider, "tests/database.db") cursor = conn.cursor() cursor.execute("SELECT MAX(id) FROM users") - + max_id = cursor.fetchone() - + assert max_id assert max_id == (2,) + def connect(provider, database): if provider == "limbo": return limbo.connect(database)