Skip to content

Commit ba14d0a

Browse files
committed
sqlite3: Add test for CREATE TABLE/INSERT/lastrowid.
1 parent 5cb3fe1 commit ba14d0a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sqlite3/test_sqlite3_2.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import sqlite3
2+
3+
4+
conn = sqlite3.connect(":memory:")
5+
6+
cur = conn.cursor()
7+
cur.execute("CREATE TABLE foo(a int)")
8+
cur.execute("INSERT INTO foo VALUES (42)")
9+
assert cur.lastrowid == 1
10+
cur.execute("SELECT * FROM foo")
11+
assert cur.fetchone() == (42,)
12+
assert cur.fetchone() is None

0 commit comments

Comments
 (0)