@@ -636,7 +636,7 @@ def drop_view(
636
636
sqlite3 .Connection | sqlalchemy .engine .Engine | sqlalchemy .engine .Connection
637
637
),
638
638
):
639
- import sqlalchemy
639
+ sqlalchemy = pytest . importorskip ( " sqlalchemy" )
640
640
from sqlalchemy import Engine
641
641
642
642
if isinstance (conn , sqlite3 .Connection ):
@@ -1209,7 +1209,12 @@ def connect_and_uuid(request, types_data):
1209
1209
if isinstance (conn , str ):
1210
1210
sqlalchemy = pytest .importorskip ("sqlalchemy" )
1211
1211
conn = sqlalchemy .create_engine (conn )
1212
- drop_table_uuid_views (conn , table_uuid , view_uuid )
1212
+ drop_table_uuid_views (conn , table_uuid , view_uuid )
1213
+ conn .dispose ()
1214
+ else :
1215
+ drop_table_uuid_views (conn , table_uuid , view_uuid )
1216
+
1217
+
1213
1218
1214
1219
1215
1220
@pytest .mark .parametrize (
@@ -1343,7 +1348,6 @@ def test_to_sql(connect_and_uuid, method, test_frame1, request):
1343
1348
def test_to_sql_exist (connect_and_uuid , mode , num_row_coef , test_frame1 , request ):
1344
1349
conn = connect_and_uuid ["conn" ]
1345
1350
table_uuid = connect_and_uuid ["table_uuid" ]
1346
- conn_name = connect_and_uuid ["conn_name" ]
1347
1351
1348
1352
with pandasSQL_builder (conn , need_transaction = True ) as pandasSQL :
1349
1353
pandasSQL .to_sql (test_frame1 , table_uuid , if_exists = "fail" )
0 commit comments