]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
cleaned up errors, only check for connection timeout for now
authorJohn Anderson <sontek@gmail.com>
Mon, 18 Mar 2013 22:04:30 +0000 (15:04 -0700)
committerJohn Anderson <sontek@gmail.com>
Mon, 18 Mar 2013 22:04:30 +0000 (15:04 -0700)
lib/sqlalchemy/dialects/mssql/pymssql.py
test/dialect/test_mssql.py

index 0754f7f764d87f0c9f6a12ca9e3d071cf832d6e5..08e8fca6a26f1bdfda747d560d77d18266f6f7c7 100644 (file)
@@ -85,9 +85,8 @@ class MSDialect_pymssql(MSDialect):
 
     def is_disconnect(self, e, connection, cursor):
         for msg in (
-            "Error 20003",  # Connection Timeout
-            "Error 20004",  # Read from SQL server failed
-            "Error 20006",  # Write to SQL Server failed
+            "Adaptive Server connection timed out",
+            "message 20003",  # connection timeout
             "Error 10054",
             "Not connected to any MS SQL server",
             "Connection is closed"
index b38d763723897bc56c361d5c98c4ea412b61f525..bddc88777958a286212e4e855a68ffd63866020f 100644 (file)
@@ -1323,8 +1323,8 @@ class ParseConnectTest(fixtures.TestBase, AssertsCompiledSQL):
     def test_pymssql_disconnect(self):
         dialect = pymssql.dialect()
 
-        for error in ['20003', '20003', '20006']:
-            eq_(dialect.is_disconnect('Error %s' % error, None, None), True)
+        for error in ['Adaptive Server connection timed out', 'message 20003']:
+            eq_(dialect.is_disconnect(error, None, None), True)
 
     @testing.only_on(['mssql+pyodbc', 'mssql+pymssql'], "FreeTDS specific test")
     def test_bad_freetds_warning(self):