1
+ from __future__ import with_statement
1
2
from pandas .util .py3compat import StringIO
2
3
import unittest
3
4
import sqlite3
4
5
import sys
5
6
7
+ import warnings
8
+
6
9
import nose
7
10
8
11
import numpy as np
@@ -297,7 +300,9 @@ def test_execute(self):
297
300
drop_sql = "DROP TABLE IF EXISTS test"
298
301
create_sql = sql .get_schema (frame , 'test' , 'mysql' )
299
302
cur = self .db .cursor ()
300
- cur .execute (drop_sql )
303
+ with warnings .catch_warnings ():
304
+ warnings .filterwarnings ("ignore" , "Unknown table.*" )
305
+ cur .execute (drop_sql )
301
306
cur .execute (create_sql )
302
307
ins = "INSERT INTO test VALUES (%s, %s, %s, %s)"
303
308
@@ -388,7 +393,9 @@ def _check_roundtrip(self, frame):
388
393
_skip_if_no_MySQLdb ()
389
394
drop_sql = "DROP TABLE IF EXISTS test_table"
390
395
cur = self .db .cursor ()
391
- cur .execute (drop_sql )
396
+ with warnings .catch_warnings ():
397
+ warnings .filterwarnings ("ignore" , "Unknown table.*" )
398
+ cur .execute (drop_sql )
392
399
sql .write_frame (frame , name = 'test_table' , con = self .db , flavor = 'mysql' )
393
400
result = sql .read_frame ("select * from test_table" , self .db )
394
401
@@ -405,7 +412,9 @@ def _check_roundtrip(self, frame):
405
412
frame2 ['Idx' ] = index
406
413
drop_sql = "DROP TABLE IF EXISTS test_table2"
407
414
cur = self .db .cursor ()
408
- cur .execute (drop_sql )
415
+ with warnings .catch_warnings ():
416
+ warnings .filterwarnings ("ignore" , "Unknown table.*" )
417
+ cur .execute (drop_sql )
409
418
sql .write_frame (frame2 , name = 'test_table2' , con = self .db , flavor = 'mysql' )
410
419
result = sql .read_frame ("select * from test_table2" , self .db ,
411
420
index_col = 'Idx' )
0 commit comments