From a6dcb3b683d10b695eeef6b5af0940193bfad315 Mon Sep 17 00:00:00 2001 From: farcepest Date: Tue, 2 Oct 2012 14:15:12 -0400 Subject: [PATCH] Travis testing fixes Squashed commit of the following: commit 17fb6798cd94b0ddae7390b5a7c6262b40de04dc Author: farcepest Date: Tue Oct 2 14:03:57 2012 -0400 Add a build status widget for Travis commit 1cd83ef78e628d6755eaa6dfc84d1205519381d4 Author: farcepest Date: Tue Oct 2 13:59:48 2012 -0400 Rewrite the repository root README commit 72848c84bce119b34469ea9113a616bfe8ee4202 Author: farcepest Date: Tue Oct 2 13:50:00 2012 -0400 Somehow I missed this connection setup commit 413c3b6623c65e9591388e3fc3b65f88b7be0ce4 Author: farcepest Date: Tue Oct 2 13:19:09 2012 -0400 Giving Travis it's own database with utf8 charset in hopes this will fix the callproc test (which works everywhere else) commit 400112e0c348b58d5d11a9a9b1cd4d88f02ba23d Author: farcepest Date: Tue Oct 2 13:06:00 2012 -0400 Update the Travis config so that the tests use the correct database configuration file commit ae94e44ed10f9c9ef7e14ea94ac522d7c1c6437f Author: farcepest Date: Tue Oct 2 12:59:29 2012 -0400 Add Travis-specific configuration file commit 3581603f45b754b457b4f5f3c7d58a82bd8c04d5 Merge: f42c369 d0e96c7 Author: farcepest Date: Tue Oct 2 12:58:00 2012 -0400 Merge branch 'master' into MySQLdb-1.2 Conflicts: MySQLdb/tests/test_MySQLdb_capabilities.py MySQLdb/tests/test_MySQLdb_dbapi20.py commit f42c369300c856c2bbcc440cd68286bca7a93be8 Author: Andy Dustman Date: Mon Oct 1 13:43:00 2012 -0400 Maybe a subshell will do the trick? commit fb346e1d40ec1861c7b9169d99e787ff4dc8b25f Author: Andy Dustman Date: Mon Oct 1 13:35:50 2012 -0400 Travis can't build for Python 2.4 it seems, and the test still weren't all running commit 2f661f09913a2261203ca03720286828680235b1 Author: Andy Dustman Date: Mon Oct 1 13:31:40 2012 -0400 OK, this should hopefully fix the build process for Travis commit 899c3342b221031c7fa174a506fbb0f71b68d6c0 Author: Andy Dustman Date: Mon Oct 1 13:28:14 2012 -0400 More Travis fixes commit 8f593def7bf237126aec2b0b85685f271de911e9 Author: Andy Dustman Date: Mon Oct 1 13:19:39 2012 -0400 Fix test script due to source being down one level. commit 1936b93cf05497450a3d99819dab7a645c157299 Author: Andy Dustman Date: Mon Oct 1 13:14:38 2012 -0400 Test connection tweaks for Travis commit 9bf8bcf894b98784e3787c9d6a57574a4ae8dced Merge: 7ae4f55 d551f8a Author: Andy Dustman Date: Mon Oct 1 13:10:58 2012 -0400 Merge branch 'travis' into MySQLdb-1.2 commit d551f8a8d9c13b03f5ff3255804a5f20a97d93c7 Author: Andy Dustman Date: Mon Oct 1 13:05:25 2012 -0400 Initial Travis setup commit 7ae4f5549b3fb46cc9b71baeaa96d2e1cc5c86a1 Merge: 235d846 c16bc33 Author: farcepest Date: Thu Sep 27 12:49:07 2012 -0400 Merge remote-tracking branch 'origin/MySQLdb-1.2' into MySQLdb-1.2 commit 235d8466ddd65b3b61f30d51d0bef0a7d13a10fe Author: farcepest Date: Thu Sep 27 12:18:07 2012 -0400 History updates for 1.2.4b2 commit 5fda4c2579be93cafe571d27527815fbb17945c4 Author: farcepest Date: Thu Sep 27 12:06:58 2012 -0400 Revert raise exc as value statements to raise exc, value since it breaks Python < 2.6. commit 048b70d90157d9526b89013b51b80afd70883292 Author: farcepest Date: Wed Sep 26 16:02:05 2012 -0400 Fix MySQLdb1-1 Exception format incompatible with previous versions Unfortunately, when I broke this, I broke the test at the same time. That should have been a red flag. commit 162e9e4d84a4b6f2c8320347f2390a9e18af1b29 Author: Andy Dustman Date: Tue Sep 25 19:56:49 2012 -0400 General cleanups --- .travis.yml | 8 ++++++++ MySQLdb/tests/capabilities.py | 3 +-- MySQLdb/tests/test_MySQLdb_nonstandard.py | 3 ++- MySQLdb/tests/travis.cnf | 10 ++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .travis.yml create mode 100644 MySQLdb/tests/travis.cnf 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