@@ -137,10 +137,9 @@ def test_commit(tmp_path):
137137 driver = driver_path ,
138138 entrypoint = "duckdb_adbc_init" ,
139139 db_kwargs = db_kwargs ,
140- ) as conn :
141- with conn .cursor () as cur :
142- cur .execute ("SELECT count(*) from ingest" )
143- assert cur .fetch_arrow_table ().to_pydict () == {"count_star()" : [4 ]}
140+ ) as conn , conn .cursor () as cur :
141+ cur .execute ("SELECT count(*) from ingest" )
142+ assert cur .fetch_arrow_table ().to_pydict () == {"count_star()" : [4 ]}
144143
145144
146145def test_connection_get_table_schema (duck_conn ):
@@ -308,11 +307,10 @@ def test_large_chunk(tmp_path):
308307 entrypoint = "duckdb_adbc_init" ,
309308 db_kwargs = db_kwargs ,
310309 autocommit = True ,
311- ) as conn :
312- with conn .cursor () as cur :
313- cur .adbc_ingest ("ingest" , table , "create" )
314- cur .execute ("SELECT count(*) from ingest" )
315- assert cur .fetch_arrow_table ().to_pydict () == {"count_star()" : [30_000 ]}
310+ ) as conn , conn .cursor () as cur :
311+ cur .adbc_ingest ("ingest" , table , "create" )
312+ cur .execute ("SELECT count(*) from ingest" )
313+ assert cur .fetch_arrow_table ().to_pydict () == {"count_star()" : [30_000 ]}
316314
317315
318316def test_dictionary_data (tmp_path ):
@@ -332,13 +330,12 @@ def test_dictionary_data(tmp_path):
332330 entrypoint = "duckdb_adbc_init" ,
333331 db_kwargs = db_kwargs ,
334332 autocommit = True ,
335- ) as conn :
336- with conn .cursor () as cur :
337- cur .adbc_ingest ("ingest" , table , "create" )
338- cur .execute ("from ingest" )
339- assert cur .fetch_arrow_table ().to_pydict () == {
340- "fruits" : ["apple" , "banana" , "apple" , "orange" , "banana" , "banana" ]
341- }
333+ ) as conn , conn .cursor () as cur :
334+ cur .adbc_ingest ("ingest" , table , "create" )
335+ cur .execute ("from ingest" )
336+ assert cur .fetch_arrow_table ().to_pydict () == {
337+ "fruits" : ["apple" , "banana" , "apple" , "orange" , "banana" , "banana" ]
338+ }
342339
343340
344341def test_ree_data (tmp_path ):
@@ -358,13 +355,12 @@ def test_ree_data(tmp_path):
358355 entrypoint = "duckdb_adbc_init" ,
359356 db_kwargs = db_kwargs ,
360357 autocommit = True ,
361- ) as conn :
362- with conn .cursor () as cur :
363- cur .adbc_ingest ("ingest" , table , "create" )
364- cur .execute ("from ingest" )
365- assert cur .fetch_arrow_table ().to_pydict () == {
366- "fruits" : ["apple" , "apple" , "apple" , "banana" , "banana" , "orange" ]
367- }
358+ ) as conn , conn .cursor () as cur :
359+ cur .adbc_ingest ("ingest" , table , "create" )
360+ cur .execute ("from ingest" )
361+ assert cur .fetch_arrow_table ().to_pydict () == {
362+ "fruits" : ["apple" , "apple" , "apple" , "banana" , "banana" , "orange" ]
363+ }
368364
369365
370366def sorted_get_objects (catalogs ):
0 commit comments