# Fix the access conversions to properly recognize unicode/binary
FIELD_TYPE = MySQLdb.constants.FIELD_TYPE
FLAG = MySQLdb.constants.FLAG
-CONVERSIONS = copy.deepcopy(MySQLdb.converters.conversions)
+CONVERSIONS = copy.copy(MySQLdb.converters.conversions)
field_types = [FIELD_TYPE.BLOB, FIELD_TYPE.STRING, FIELD_TYPE.VAR_STRING]
if 'VARCHAR' in vars(FIELD_TYPE):
field_types.append(FIELD_TYPE.VARCHAR)
for field_type in field_types:
- CONVERSIONS[field_type].insert(0, (FLAG.BINARY, str))
+ CONVERSIONS[field_type] = [(FLAG.BINARY, str)] + CONVERSIONS[field_type]
# Alias some common MySQL exceptions
import tornado.web
import tornado.websocket
import tornado.wsgi
+
+ # for modules with dependencies, if those dependencies can be loaded,
+ # load them too.
+
+ def test_import_pycurl(self):
+ try:
+ import pycurl
+ except ImportError:
+ pass
+ else:
+ import tornado.curl_httpclient
+
+ def test_import_mysqldb(self):
+ try:
+ import MySQLdb
+ except ImportError:
+ pass
+ else:
+ import tornado.database
+
+ def test_import_twisted(self):
+ try:
+ import twisted
+ except ImportError:
+ pass
+ else:
+ import tornado.platform.twisted
#
# See also tornado/test/run_pyversion_tests.py, which is faster but
# less thorough.
+#
+# On my macports-based setup, the environment variable
+# ARCHFLAGS='-arch x86_64' must be set when building pycurl, and a
+# symlink from mysql_config to mysql_config5 must exist when building
+# MySQL-python.
[tox]
# "-full" variants include optional dependencies, to ensure
# that things work both in a bare install and with all the extras.
-envlist = py25, py25-full, py26, py26-full, py27, py27-full, pypy, py32
+envlist = py25, py25-full, py26, py26-full, py27, py27-full, pypy, pypy-full, py32
[testenv]
commands = python -m tornado.test.runtests {posargs:}
[testenv:py25-full]
basepython = python2.5
-# pycurl doesn't install cleanly for me from pip on 2.5, so get it from
-# the system python.
-sitepackages = True
deps =
+ MySQL-python
pycurl
simplejson
twisted
[testenv:py26-full]
basepython = python2.6
deps =
+ MySQL-python
pycurl
twisted
[testenv:py27-full]
basepython = python2.7
deps =
+ MySQL-python
pycurl
twisted
-# No pypy-full yet: pycurl doesn't build, and installing twisted
-# under pypy takes a *very* long time. Neither package works on python3.
+[testenv:pypy-full]
+# pycurl doesn't build with pypy, and installing twisted under pypy takes
+# a *very* long time
+basepython = pypy
+deps =
+ MySQL-python
+
+# No py32-full yet: none of our dependencies currently work on python3.