More tests tweaks

Named cursors on old server versions have a different prefetch behaviour.
This has hidden me the supported range of the 24:00 time format.
Let's have another go at full testing...
This commit is contained in:
Daniele Varrazzo 2015-02-08 12:50:02 +00:00
parent a2a5461c28
commit 77df287e14
2 changed files with 2 additions and 1 deletions

View File

@ -309,7 +309,7 @@ class DatetimeTests(ConnectingTestCase, CommonDatetimeTestsMixin):
from datetime import timedelta from datetime import timedelta
self._test_type_roundtrip_array(timedelta(seconds=30)) self._test_type_roundtrip_array(timedelta(seconds=30))
@skip_before_postgres(8, 4) @skip_before_postgres(8, 1)
def test_time_24(self): def test_time_24(self):
from datetime import time from datetime import time

View File

@ -207,6 +207,7 @@ class WithCursorTestCase(WithTestCase):
with self.conn as conn: with self.conn as conn:
with conn.cursor('named') as cur: with conn.cursor('named') as cur:
cur.execute("select 1/0") cur.execute("select 1/0")
cur.fetchone()
except psycopg2.DataError, e: except psycopg2.DataError, e:
self.assertEqual(e.pgcode, '22012') self.assertEqual(e.pgcode, '22012')
else: else: