summaryrefslogtreecommitdiff
path: root/tests/test_errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_errors.py')
-rwxr-xr-xtests/test_errors.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_errors.py b/tests/test_errors.py
index bd3e7fd..ec2950c 100755
--- a/tests/test_errors.py
+++ b/tests/test_errors.py
@@ -62,6 +62,13 @@ class ErrorsTests(ConnectingTestCase):
with self.assertRaises(KeyError):
errors.lookup('XXXXX')
+ def test_connection_exceptions_backwards_compatibility(self):
+ err = errors.lookup('08000')
+ # connection exceptions are classified as operational errors
+ self.assert_(issubclass(err, errors.OperationalError))
+ # previously these errors were classified only as DatabaseError
+ self.assert_(issubclass(err, errors.DatabaseError))
+
def test_has_base_exceptions(self):
excs = []
for n in dir(psycopg2):