summaryrefslogtreecommitdiff
path: root/test/lib/engines.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-01-26 11:18:03 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-01-26 11:18:03 -0500
commit1515073b960b2319bd77ed6e9f6e04e458636a1e (patch)
tree31d382c11cea9ecc7de88a3b9d06ad3a7167b9d9 /test/lib/engines.py
parent9122268ed03d9fb59fafb62ee5a435775f1020d5 (diff)
downloadsqlalchemy-1515073b960b2319bd77ed6e9f6e04e458636a1e.tar.gz
- New DBAPI support for pymysql, a pure Python port
of MySQL-python. [ticket:1991]
Diffstat (limited to 'test/lib/engines.py')
-rw-r--r--test/lib/engines.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/test/lib/engines.py b/test/lib/engines.py
index e6ea246e6..1acbdaf27 100644
--- a/test/lib/engines.py
+++ b/test/lib/engines.py
@@ -147,19 +147,15 @@ def utf8_engine(url=None, options=None):
from sqlalchemy.engine import url as engine_url
- if config.db.driver == 'mysqldb' and config.db.dialect.name != 'drizzle':
- dbapi_ver = config.db.dialect.dbapi.version_info
- if (dbapi_ver < (1, 2, 1) or
- dbapi_ver in ((1, 2, 1, 'gamma', 1), (1, 2, 1, 'gamma', 2),
- (1, 2, 1, 'gamma', 3), (1, 2, 1, 'gamma', 5))):
- raise RuntimeError('Character set support unavailable with this '
- 'driver version: %s' % repr(dbapi_ver))
- else:
- url = url or config.db_url
- url = engine_url.make_url(url)
- url.query['charset'] = 'utf8'
- url.query['use_unicode'] = '0'
- url = str(url)
+ if config.db.dialect.name == 'mysql' and \
+ config.db.driver in ['mysqldb', 'pymysql']:
+ # note 1.2.1.gamma.6 or greater of MySQLdb
+ # needed here
+ url = url or config.db_url
+ url = engine_url.make_url(url)
+ url.query['charset'] = 'utf8'
+ url.query['use_unicode'] = '0'
+ url = str(url)
return testing_engine(url, options)