mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-30 12:34:52 -04:00
cleaned up errors, only check for connection timeout for now
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user