@@ -23,9 +23,7 @@ async def test_connect_and_query(self, cluster_address: str) -> None:
2323 async def test_create_table_and_insert (self , cluster_address : str ) -> None :
2424 async with await connect (cluster_address ) as conn :
2525 await conn .execute ("DROP TABLE IF EXISTS test_single" )
26- await conn .execute (
27- "CREATE TABLE test_single (id INTEGER PRIMARY KEY, name TEXT)"
28- )
26+ await conn .execute ("CREATE TABLE test_single (id INTEGER PRIMARY KEY, name TEXT)" )
2927 await conn .execute ("INSERT INTO test_single (name) VALUES (?)" , ["test" ])
3028
3129 rows = await conn .fetch ("SELECT * FROM test_single WHERE name = ?" , ["test" ])
@@ -35,9 +33,7 @@ async def test_create_table_and_insert(self, cluster_address: str) -> None:
3533 async def test_transaction_commit (self , cluster_address : str ) -> None :
3634 async with await connect (cluster_address ) as conn :
3735 await conn .execute ("DROP TABLE IF EXISTS test_tx" )
38- await conn .execute (
39- "CREATE TABLE test_tx (id INTEGER PRIMARY KEY, val TEXT)"
40- )
36+ await conn .execute ("CREATE TABLE test_tx (id INTEGER PRIMARY KEY, val TEXT)" )
4137
4238 async with conn .transaction ():
4339 await conn .execute ("INSERT INTO test_tx (val) VALUES (?)" , ["committed" ])
@@ -48,9 +44,7 @@ async def test_transaction_commit(self, cluster_address: str) -> None:
4844 async def test_transaction_rollback (self , cluster_address : str ) -> None :
4945 async with await connect (cluster_address ) as conn :
5046 await conn .execute ("DROP TABLE IF EXISTS test_rollback" )
51- await conn .execute (
52- "CREATE TABLE test_rollback (id INTEGER PRIMARY KEY, val TEXT)"
53- )
47+ await conn .execute ("CREATE TABLE test_rollback (id INTEGER PRIMARY KEY, val TEXT)" )
5448
5549 try :
5650 async with conn .transaction ():
@@ -61,18 +55,14 @@ async def test_transaction_rollback(self, cluster_address: str) -> None:
6155 except ValueError :
6256 pass
6357
64- rows = await conn .fetch (
65- "SELECT * FROM test_rollback WHERE val = ?" , ["rollback_test" ]
66- )
58+ rows = await conn .fetch ("SELECT * FROM test_rollback WHERE val = ?" , ["rollback_test" ])
6759 assert len (rows ) == 0
6860
6961 async def test_unicode_text (self , cluster_address : str ) -> None :
7062 """Test Unicode text handling including emojis, CJK, RTL."""
7163 async with await connect (cluster_address ) as conn :
7264 await conn .execute ("DROP TABLE IF EXISTS test_unicode" )
73- await conn .execute (
74- "CREATE TABLE test_unicode (id INTEGER PRIMARY KEY, val TEXT)"
75- )
65+ await conn .execute ("CREATE TABLE test_unicode (id INTEGER PRIMARY KEY, val TEXT)" )
7666
7767 unicode_values = [
7868 # Emojis (4-byte UTF-8)
@@ -109,9 +99,7 @@ async def test_binary_blob(self, cluster_address: str) -> None:
10999 """Test binary blob handling including null bytes."""
110100 async with await connect (cluster_address ) as conn :
111101 await conn .execute ("DROP TABLE IF EXISTS test_blob" )
112- await conn .execute (
113- "CREATE TABLE test_blob (id INTEGER PRIMARY KEY, data BLOB)"
114- )
102+ await conn .execute ("CREATE TABLE test_blob (id INTEGER PRIMARY KEY, data BLOB)" )
115103
116104 blob_values = [
117105 b"simple" ,
@@ -126,9 +114,7 @@ async def test_binary_blob(self, cluster_address: str) -> None:
126114 await conn .execute ("INSERT INTO test_blob (data) VALUES (?)" , [val ])
127115
128116 # Retrieve and verify
129- rows = await conn .fetch (
130- "SELECT data FROM test_blob ORDER BY id DESC LIMIT 1"
131- )
117+ rows = await conn .fetch ("SELECT data FROM test_blob ORDER BY id DESC LIMIT 1" )
132118 assert len (rows ) == 1
133119 assert rows [0 ]["data" ] == val , f"Mismatch for blob: { repr (val )} "
134120
@@ -172,9 +158,7 @@ async def test_boolean_values(self, cluster_address: str) -> None:
172158 """Test boolean handling (SQLite uses INTEGER 0/1)."""
173159 async with await connect (cluster_address ) as conn :
174160 await conn .execute ("DROP TABLE IF EXISTS test_bool" )
175- await conn .execute (
176- "CREATE TABLE test_bool (id INTEGER PRIMARY KEY, flag INTEGER)"
177- )
161+ await conn .execute ("CREATE TABLE test_bool (id INTEGER PRIMARY KEY, flag INTEGER)" )
178162
179163 # Insert True and False as integers (SQLite doesn't have native BOOLEAN)
180164 await conn .execute ("INSERT INTO test_bool (flag) VALUES (?)" , [1 ])
@@ -190,21 +174,16 @@ async def test_datetime_as_text(self, cluster_address: str) -> None:
190174 async with await connect (cluster_address ) as conn :
191175 await conn .execute ("DROP TABLE IF EXISTS test_datetime" )
192176 await conn .execute (
193- "CREATE TABLE test_datetime "
194- "(id INTEGER PRIMARY KEY, created_at TEXT)"
177+ "CREATE TABLE test_datetime (id INTEGER PRIMARY KEY, created_at TEXT)"
195178 )
196179
197180 # Store datetime as ISO8601 string
198181 now = datetime .datetime .now ()
199182 iso_string = now .isoformat ()
200183
201- await conn .execute (
202- "INSERT INTO test_datetime (created_at) VALUES (?)" , [iso_string ]
203- )
184+ await conn .execute ("INSERT INTO test_datetime (created_at) VALUES (?)" , [iso_string ])
204185
205- rows = await conn .fetch (
206- "SELECT created_at FROM test_datetime ORDER BY id DESC LIMIT 1"
207- )
186+ rows = await conn .fetch ("SELECT created_at FROM test_datetime ORDER BY id DESC LIMIT 1" )
208187 assert len (rows ) == 1
209188 assert rows [0 ]["created_at" ] == iso_string
210189
0 commit comments