From e490e3bfa33b6a60606cb0a6b445f364dbe09ff3 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 8 Feb 2015 02:04:41 +0000 Subject: [PATCH] Accept overflow errors testing for LO64 funcs It is raised on 32 bits by PyArg_ParseTuple. We may work around on truncate (maybe parsing a py_ssize_t) but we would have the same problem on seek as the offset is signed. --- tests/test_lobject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_lobject.py b/tests/test_lobject.py index 9532770b..fb2297fa 100755 --- a/tests/test_lobject.py +++ b/tests/test_lobject.py @@ -488,14 +488,14 @@ class LargeObjectNot64Tests(LargeObjectTestCase): lo = self.conn.lobject() offset = 1 << 32 # 4gb self.assertRaises( - (psycopg2.InterfaceError, psycopg2.NotSupportedError), + (OverflowError, psycopg2.InterfaceError, psycopg2.NotSupportedError), lo.seek, offset, 0) def test_truncate_larger_than_2gb(self): lo = self.conn.lobject() length = 1 << 32 # 4gb self.assertRaises( - (psycopg2.InterfaceError, psycopg2.NotSupportedError), + (OverflowError, psycopg2.InterfaceError, psycopg2.NotSupportedError), lo.truncate, length) decorate_all_tests(LargeObjectNot64Tests,