]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added a non-freetds specific exclusion for pyodbc
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Mar 2010 02:23:25 +0000 (21:23 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 12 Mar 2010 02:23:25 +0000 (21:23 -0500)
lib/sqlalchemy/dialects/mssql/pyodbc.py
test/sql/test_query.py

index a4c7d4bfcf7e6dd155a529b2d020111238e9ce1e..9ef065b1a969626a43193d6ea04749b0d1944dcc 100644 (file)
@@ -66,13 +66,13 @@ class MSDialect_pyodbc(PyODBCConnector, MSDialect):
         
         dbapi_con = connection.connection
         
-        self._free_tds = re.match(r".*libtdsodbc.*\.so",  dbapi_con.getinfo(pyodbc.SQL_DRIVER_NAME))
+        self.freetds = re.match(r".*libtdsodbc.*\.so",  dbapi_con.getinfo(pyodbc.SQL_DRIVER_NAME))
     
         # the "Py2K only" part here is theoretical.
         # have not tried pyodbc + python3.1 yet.
         # Py2K
-        self.supports_unicode_statements = not self._free_tds
-        self.supports_unicode_binds = not self._free_tds
+        self.supports_unicode_statements = not self.freetds
+        self.supports_unicode_binds = not self.freetds
         # end Py2K
         
 dialect = MSDialect_pyodbc
index 62da772a4c855b442336cabe04331748a8d22215..064cfb236bac84ee77143efcc96d4ae4ebe11059 100644 (file)
@@ -769,6 +769,10 @@ class QueryTest(TestBase):
 
     @testing.emits_warning('.*empty sequence.*')
     @testing.fails_on('firebird', "kinterbasdb doesn't send full type information")
+    @testing.fails_if(lambda: 
+                         (testing.db.name, testing.db.driver == 'mssql', 'pyodbc')
+                         and not testing.db.dialect.freetds,
+                         "not supported by Windows ODBC driver")
     def test_bind_in(self):
         users.insert().execute(user_id = 7, user_name = 'jack')
         users.insert().execute(user_id = 8, user_name = 'fred')