@@ -1257,6 +1257,7 @@ def test_default_type_conversion(conn, request):
1257
1257
@pytest .mark .parametrize ("conn" , mysql_connectable )
1258
1258
def test_read_procedure (conn , request ):
1259
1259
conn = request .getfixturevalue (conn )
1260
+ table_uuid = table_uuid_gen ("test_frame" )
1260
1261
1261
1262
# GH 7324
1262
1263
# Although it is more an api test, it is added to the
@@ -1265,14 +1266,14 @@ def test_read_procedure(conn, request):
1265
1266
from sqlalchemy .engine import Engine
1266
1267
1267
1268
df = DataFrame ({"a" : [1 , 2 , 3 ], "b" : [0.1 , 0.2 , 0.3 ]})
1268
- df .to_sql (name = "test_frame" , con = conn , index = False )
1269
+ df .to_sql (name = table_uuid , con = conn , index = False )
1269
1270
1270
- proc = """DROP PROCEDURE IF EXISTS get_testdb;
1271
+ proc = f """DROP PROCEDURE IF EXISTS get_testdb;
1271
1272
1272
1273
CREATE PROCEDURE get_testdb ()
1273
1274
1274
1275
BEGIN
1275
- SELECT * FROM test_frame ;
1276
+ SELECT * FROM { table_uuid } ;
1276
1277
END"""
1277
1278
proc = text (proc )
1278
1279
if isinstance (conn , Engine ):
@@ -1419,6 +1420,7 @@ def test_to_sql_on_public_schema(conn, request):
1419
1420
def test_insertion_method_on_conflict_update (conn , request ):
1420
1421
# GH 14553: Example in to_sql docstring
1421
1422
conn = request .getfixturevalue (conn )
1423
+ table_uuid = table_uuid_gen ("test_insert_conflict" )
1422
1424
1423
1425
from sqlalchemy .dialects .mysql import insert
1424
1426
from sqlalchemy .engine import Engine
@@ -1432,8 +1434,8 @@ def insert_on_conflict(table, conn, keys, data_iter):
1432
1434
return result .rowcount
1433
1435
1434
1436
create_sql = text (
1435
- """
1436
- CREATE TABLE test_insert_conflict (
1437
+ f """
1438
+ CREATE TABLE { table_uuid } (
1437
1439
a INT PRIMARY KEY,
1438
1440
b FLOAT,
1439
1441
c VARCHAR(10)
@@ -1449,23 +1451,23 @@ def insert_on_conflict(table, conn, keys, data_iter):
1449
1451
conn .execute (create_sql )
1450
1452
1451
1453
df = DataFrame ([[1 , 2.1 , "a" ]], columns = list ("abc" ))
1452
- df .to_sql (name = "test_insert_conflict" , con = conn , if_exists = "append" , index = False )
1454
+ df .to_sql (name = table_uuid , con = conn , if_exists = "append" , index = False )
1453
1455
1454
1456
expected = DataFrame ([[1 , 3.2 , "b" ]], columns = list ("abc" ))
1455
1457
inserted = expected .to_sql (
1456
- name = "test_insert_conflict" ,
1458
+ name = table_uuid ,
1457
1459
con = conn ,
1458
1460
index = False ,
1459
1461
if_exists = "append" ,
1460
1462
method = insert_on_conflict ,
1461
1463
)
1462
- result = sql .read_sql_table ("test_insert_conflict" , conn )
1464
+ result = sql .read_sql_table (table_uuid , conn )
1463
1465
tm .assert_frame_equal (result , expected )
1464
1466
assert inserted == 2
1465
1467
1466
1468
# Cleanup
1467
1469
with sql .SQLDatabase (conn , need_transaction = True ) as pandasSQL :
1468
- pandasSQL .drop_table ("test_insert_conflict" )
1470
+ pandasSQL .drop_table (table_uuid )
1469
1471
1470
1472
1471
1473
@pytest .mark .parametrize ("conn" , postgresql_connectable )
0 commit comments