diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..af7abea --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: python +python: + - "2.5" + - "2.6" + - "2.7" +install: (cd MySQLdb && python setup.py install) +before_script: mysql -e 'create database mysqldb_test charset utf8;' +script: (cd MySQLdb && TESTDB=travis.cnf nosetests) diff --git a/MySQLdb/tests/capabilities.py b/MySQLdb/tests/capabilities.py index 076361c..dd302b9 100644 --- a/MySQLdb/tests/capabilities.py +++ b/MySQLdb/tests/capabilities.py @@ -8,7 +8,6 @@ from time import time import array import unittest -from configdb import connection_factory class DatabaseTest(unittest.TestCase): @@ -22,7 +21,7 @@ class DatabaseTest(unittest.TestCase): def setUp(self): import gc - db = connection_factory(**self.connect_kwargs) + db = self.db_module.connect(*self.connect_args, **self.connect_kwargs) self.connection = db self.cursor = db.cursor() # TODO: this needs to be re-evaluated for Python 3 diff --git a/MySQLdb/tests/test_MySQLdb_nonstandard.py b/MySQLdb/tests/test_MySQLdb_nonstandard.py index 150d013..92fcbdc 100644 --- a/MySQLdb/tests/test_MySQLdb_nonstandard.py +++ b/MySQLdb/tests/test_MySQLdb_nonstandard.py @@ -3,6 +3,7 @@ import unittest import _mysql import MySQLdb from MySQLdb.constants import FIELD_TYPE +from configdb import connection_factory class TestDBAPISet(unittest.TestCase): @@ -44,7 +45,7 @@ class CoreAPI(unittest.TestCase): """Test _mysql interaction internals.""" def setUp(self): - self.conn = _mysql.connect(db='test', host='127.0.0.1', user='test') #read_default_file="~/.my.cnf") + self.conn = connection_factory(use_unicode=True) def tearDown(self): self.conn.close() diff --git a/MySQLdb/tests/travis.cnf b/MySQLdb/tests/travis.cnf new file mode 100644 index 0000000..e78f52d --- /dev/null +++ b/MySQLdb/tests/travis.cnf @@ -0,0 +1,10 @@ +# To create your own custom version of this file, read +# http://dev.mysql.com/doc/refman/5.1/en/option-files.html +# and set TESTDB in your environment to the name of the file + +[MySQLdb-tests] +host = 127.0.0.1 +user = root +database = mysqldb_test +#password = +default-character-set = utf8