Permalink
Browse files

Merge pull request #6 from taavi/master

Add libmysqlclient.so.15 and a --mysql-password test option
  • Loading branch information...
alex committed Jul 26, 2011
2 parents 983f381 + 14b1188 commit 32d79b05c2394875ed9dec45eac69ede3bc45384
Showing with 9 additions and 2 deletions.
  1. +1 −1 MySQLdb/libmysql.py
  2. +7 −1 tests/conftest.py
  3. +1 −0 tests/test_dbapi20.py
View
@@ -44,7 +44,7 @@ class MYSQL_FIELD(ctypes.Structure):
c = None
# Prefer the higher version, obscure.
-for lib in ["libmysqlclient.so.16", "mysqlclient", "libmysqlclient.18.dylib"]:
+for lib in ["libmysqlclient.so.16", "libmysqlclient.so.15", "mysqlclient", "libmysqlclient.18.dylib"]:
try:
c = ctypes.CDLL(lib)
except OSError:
View
@@ -13,6 +13,11 @@ def pytest_addoption(parser):
default = "root",
dest = "mysql_user",
)
+ group.addoption(
+ "--mysql-password",
+ default = None,
+ dest = "mysql_passwd",
+ )
group.addoption(
"--mysql-database",
default = "test_mysqldb",
@@ -25,7 +30,8 @@ def pytest_funcarg__connection(request):
if hasattr(request.function, "connect_opts"):
extra_kwargs = request.function.connect_opts.kwargs.copy()
conn = MySQLdb.connect(
- host=option.mysql_host, user=option.mysql_user, db=option.mysql_database, **extra_kwargs
+ host=option.mysql_host, user=option.mysql_user,
+ passwd=option.mysql_passwd, db=option.mysql_database, **extra_kwargs
)
def close_conn():
View
@@ -15,6 +15,7 @@ def setUp(self):
self.connect_kw_args = {
"host": option.mysql_host,
"user": option.mysql_user,
+ "passwd": option.mysql_passwd,
"db": option.mysql_database,
}

0 comments on commit 32d79b0

Please sign in to comment.