summaryrefslogtreecommitdiff
path: root/tests/test_cursor.py
diff options
context:
space:
mode:
authorRafi Shamim <rafi@cockroachlabs.com>2022-03-28 12:44:50 -0400
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2022-03-28 20:26:23 +0200
commit3c58e96e1000ef60060fb8139687028cb274838d (patch)
treeafe908df896e6c0a446763593bdff88694a79f03 /tests/test_cursor.py
parent626078388a12a20f43f03e630bded46d7da00b75 (diff)
downloadpsycopg2-3c58e96e1000ef60060fb8139687028cb274838d.tar.gz
Unskip tests that work on CockroachDB v22.1
CockroachDB supports named cursors in v22.1, so more tests pass.
Diffstat (limited to 'tests/test_cursor.py')
-rwxr-xr-xtests/test_cursor.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_cursor.py b/tests/test_cursor.py
index 04f535a..48a9e78 100755
--- a/tests/test_cursor.py
+++ b/tests/test_cursor.py
@@ -412,7 +412,7 @@ class CursorTests(ConnectingTestCase):
self.assert_(curs.pgresult_ptr is None)
-@skip_if_crdb("named cursor")
+@skip_if_crdb("named cursor", version="< 22.1")
class NamedCursorTests(ConnectingTestCase):
def test_invalid_name(self):
curs = self.conn.cursor()
@@ -436,6 +436,7 @@ class NamedCursorTests(ConnectingTestCase):
curs.execute("insert into withhold values (%s)", (i,))
curs.close()
+ @skip_if_crdb("cursor with hold")
def test_withhold(self):
self.assertRaises(psycopg2.ProgrammingError, self.conn.cursor,
withhold=True)
@@ -460,6 +461,7 @@ class NamedCursorTests(ConnectingTestCase):
curs.execute("drop table withhold")
self.conn.commit()
+ @skip_if_crdb("cursor with hold")
def test_withhold_no_begin(self):
self._create_withhold_table()
curs = self.conn.cursor("w", withhold=True)
@@ -484,6 +486,7 @@ class NamedCursorTests(ConnectingTestCase):
self.assertEqual(self.conn.info.transaction_status,
psycopg2.extensions.TRANSACTION_STATUS_IDLE)
+ @skip_if_crdb("cursor with hold")
def test_withhold_autocommit(self):
self._create_withhold_table()
self.conn.commit()
@@ -506,6 +509,7 @@ class NamedCursorTests(ConnectingTestCase):
self.assertEqual(self.conn.info.transaction_status,
psycopg2.extensions.TRANSACTION_STATUS_IDLE)
+ @skip_if_crdb("scroll cursor")
def test_scrollable(self):
self.assertRaises(psycopg2.ProgrammingError, self.conn.cursor,
scrollable=True)
@@ -679,6 +683,7 @@ class NamedCursorTests(ConnectingTestCase):
self.assertRaises((IndexError, psycopg2.ProgrammingError),
cur.scroll, 1)
+ @skip_if_crdb("scroll cursor")
@skip_before_postgres(8, 0)
def test_scroll_named(self):
cur = self.conn.cursor('tmp', scrollable=True)