mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-12 07:10:33 +03:00
Fixed merge errors in the test suite
All the bugfixes from psycopg 2.5 backported on 2.4. I've done this because I've noticed Ubuntu 14.04 LTS is being released with psycopg 2.4.6: if they don't plan to switch to 2.5.x better have these bugs fixed.
This commit is contained in:
parent
ed968dd913
commit
e1eb7a71b0
|
@ -26,8 +26,9 @@ import time
|
|||
import psycopg2
|
||||
import psycopg2.extensions
|
||||
from psycopg2.extensions import b
|
||||
from testconfig import dsn, unittest, skip_before_postgres
|
||||
from testutils import skip_if_no_namedtuple, skip_if_no_getrefcount
|
||||
from testconfig import dsn
|
||||
from testutils import unittest, skip_if_no_namedtuple, skip_if_no_getrefcount
|
||||
from testutils import skip_before_postgres
|
||||
|
||||
class CursorTests(unittest.TestCase):
|
||||
|
||||
|
@ -341,19 +342,6 @@ class CursorTests(unittest.TestCase):
|
|||
self.assertRaises((IndexError, psycopg2.ProgrammingError),
|
||||
cur.scroll, 1)
|
||||
|
||||
@skip_before_postgres(8, 0)
|
||||
def test_scroll_named(self):
|
||||
cur = self.conn.cursor('tmp', scrollable=True)
|
||||
cur.execute("select generate_series(0,9)")
|
||||
cur.scroll(2)
|
||||
self.assertEqual(cur.fetchone(), (2,))
|
||||
cur.scroll(2)
|
||||
self.assertEqual(cur.fetchone(), (5,))
|
||||
cur.scroll(2, mode='relative')
|
||||
self.assertEqual(cur.fetchone(), (8,))
|
||||
cur.scroll(9, mode='absolute')
|
||||
self.assertEqual(cur.fetchone(), (9,))
|
||||
|
||||
def test_bad_subclass(self):
|
||||
# check that we get an error message instead of a segfault
|
||||
# for badly written subclasses.
|
||||
|
|
|
@ -224,7 +224,6 @@ def skip_if_no_superuser(f):
|
|||
|
||||
|
||||
def skip_if_no_getrefcount(f):
|
||||
@wraps(f)
|
||||
def skip_if_no_getrefcount_(self):
|
||||
if not hasattr(sys, 'getrefcount'):
|
||||
return self.skipTest('skipped, no sys.getrefcount()')
|
||||
|
|
Loading…
Reference in New Issue
Block a user