@@ -30,8 +30,8 @@ def test_datatypes(self):
3030 try :
3131 # insert values
3232 v = (True , - 3 , 123456789012 , 5.7 , "hello'\" world" , u"Espa\xc3 \xb1 ol" , "binary\x00 data" .encode (conn .charset ), datetime .date (1988 ,2 ,2 ), datetime .datetime (2014 , 5 , 15 , 7 , 45 , 57 ), datetime .timedelta (5 ,6 ), datetime .time (16 ,32 ), time .localtime ())
33- c .execute ("insert into test_datatypes (b,i,l,f,s,u,bb,d,dt,td,t,st) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)" , v )
34- c .execute ("select b,i,l,f,s,u,bb,d,dt,td,t,st from test_datatypes" )
33+ yield c .execute ("insert into test_datatypes (b,i,l,f,s,u,bb,d,dt,td,t,st) values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)" , v )
34+ yield c .execute ("select b,i,l,f,s,u,bb,d,dt,td,t,st from test_datatypes" )
3535 r = c .fetchone ()
3636 self .assertEqual (util .int2byte (1 ), r [0 ])
3737 self .assertEqual (v [1 :10 ], r [1 :10 ])
@@ -337,12 +337,13 @@ def test_bulk_insert_single_record(self):
337337 yield cursor .execute ('commit' )
338338 yield self ._verify_records (data )
339339
340+ @gen_test
340341 def test_issue_288 (self ):
341342 """executemany should work with "insert ... on update" """
342343 conn = self .connections [0 ]
343344 cursor = conn .cursor ()
344345 data = [(0 , "bob" , 21 , 123 ), (1 , "jim" , 56 , 45 ), (2 , "fred" , 100 , 180 )]
345- cursor .executemany ("""insert
346+ yield cursor .executemany ("""insert
346347into bulkinsert (id, name,
347348age, height)
348349values (%s,
@@ -361,17 +362,20 @@ def test_issue_288(self):
361362'fred' , 100,
362363180 ) on duplicate key update
363364age = values(age)""" ))
364- cursor .execute ('commit' )
365- self ._verify_records (data )
365+ yield cursor .execute ('commit' )
366+ yield self ._verify_records (data )
366367
368+ @gen_test
367369 def test_warnings (self ):
368370 con = self .connections [0 ]
369371 cur = con .cursor ()
370372 with warnings .catch_warnings (record = True ) as ws :
371373 warnings .simplefilter ("always" )
372- cur .execute ("drop table if exists no_exists_table" )
374+ yield cur .execute ("drop table if exists no_exists_table" )
375+ for w in ws :
376+ print (w )
373377 self .assertEqual (len (ws ), 1 )
374- self .assertEqual (ws [0 ].category , pymysql .Warning )
378+ self .assertEqual (ws [0 ].category , tornado_mysql .Warning )
375379 self .assertTrue (u"no_exists_table" in str (ws [0 ].message ))
376380
377381
0 commit comments