Short-term fix for bug #2671682.

Make tests a little more parallel to trunk version.

Add nose.collector as test_suite
This commit is contained in:
adustman
2009-03-08 16:34:49 +00:00
parent 75a6326614
commit 0e2dbef519
6 changed files with 17 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ def defaulterrorhandler(connection, cursor, errorclass, errorvalue):
connection.messages.append(error)
del cursor
del connection
raise errorclass(errorvalue)
raise errorclass, errorvalue
class Connection(_mysql.connection):

View File

@@ -212,10 +212,8 @@ class BaseCursor(object):
except TypeError, msg:
if msg.args[0] in ("not enough arguments for format string",
"not all arguments converted"):
self.messages.append((ProgrammingError, msg.args[0]))
self.errorhandler(self, ProgrammingError, msg.args[0])
else:
self.messages.append((TypeError, msg))
self.errorhandler(self, TypeError, msg)
except:
from sys import exc_info

View File

@@ -1,5 +1,5 @@
[metadata]
version: 1.2.3
version: 1.2.3b1
version_info: (1,2,3,'beta',1)
description: Python interface to MySQL
long_description:
@@ -16,8 +16,8 @@ long_description:
\n
- Thread-friendliness (threads will not block each other)
\n
MySQL-3.23 through 5.0 and Python-2.3 through 2.5 are currently
supported.
MySQL-3.23 through 5.0 and Python-2.3 through 2.6 are currently
supported. Python-3.0 will be supported in a future release.
\n
MySQLdb is `Free Software`_.
\n

View File

@@ -1,3 +1,6 @@
[test]
test_suite = nose.collector
[build_ext]
## Only uncomment/set these if the default configuration doesn't work
## Also see http://docs.python.org/dist/setup-config.html

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env python
import test_capabilities
import capabilities
import unittest
import MySQLdb
import warnings
warnings.filterwarnings('error')
class test_MySQLdb(test_capabilities.DatabaseTest):
class test_MySQLdb(capabilities.DatabaseTest):
db_module = MySQLdb
connect_args = ()
@@ -72,6 +72,14 @@ class test_MySQLdb(test_capabilities.DatabaseTest):
self.check_data_integrity(
('col1 char(1)','col2 char(1)'),
generator)
def test_bug_2671682(self):
from MySQLdb.constants import ER
try:
self.cursor.execute("describe some_non_existent_table");
except self.connection.ProgrammingError, msg:
self.failUnless(msg[0] == ER.NO_SUCH_TABLE)
if __name__ == '__main__':
if test_MySQLdb.leak_test: