Merge pull request #374 from grooverdan/more_connection_tests
add test test_no_delay_warning
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import decimal
|
import decimal
|
||||||
import pymysql
|
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
import unittest2
|
||||||
|
import pymysql
|
||||||
from pymysql.tests import base
|
from pymysql.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -74,6 +76,13 @@ class TestConnection(base.PyMySQLTestCase):
|
|||||||
self.assertEqual(('foobar',), c.fetchone())
|
self.assertEqual(('foobar',), c.fetchone())
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
@unittest2.skipUnless(sys.version_info[0:2] >= (3,2), "required py-3.2")
|
||||||
|
def test_no_delay_warning(self):
|
||||||
|
current_db = self.databases[0].copy()
|
||||||
|
current_db['no_delay'] = True
|
||||||
|
with self.assertWarns(DeprecationWarning) as cm:
|
||||||
|
conn = pymysql.connect(**current_db)
|
||||||
|
|
||||||
|
|
||||||
# A custom type and function to escape it
|
# A custom type and function to escape it
|
||||||
class Foo(object):
|
class Foo(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user