summaryrefslogtreecommitdiff
path: root/tests/test_cursor.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2018-05-20 23:56:29 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2018-05-20 23:56:29 +0100
commite8a831dda2decd26f57bb227948da8af9237fb89 (patch)
tree1395c3acd39c74989c0a891e57f01862e8cb698d /tests/test_cursor.py
parentbe3b1ba1eb84244e97a9d85ba05ef2ca6b5a213b (diff)
parenta0f7027ad578c6c2707430e9a208cc3f7510cad4 (diff)
downloadpsycopg2-e8a831dda2decd26f57bb227948da8af9237fb89.tar.gz
Merge branch 'master' into drop-2to3
Diffstat (limited to 'tests/test_cursor.py')
-rwxr-xr-xtests/test_cursor.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_cursor.py b/tests/test_cursor.py
index d522386..b48fe7f 100755
--- a/tests/test_cursor.py
+++ b/tests/test_cursor.py
@@ -119,6 +119,12 @@ class CursorTests(ConnectingTestCase):
nref2 = sys.getrefcount(foo)
self.assertEqual(nref1, nref2)
+ def test_modify_closed(self):
+ cur = self.conn.cursor()
+ cur.close()
+ sql = cur.mogrify("select %s", (10,))
+ self.assertEqual(sql, b"select 10")
+
def test_bad_placeholder(self):
cur = self.conn.cursor()
self.assertRaises(psycopg2.ProgrammingError,
@@ -431,6 +437,11 @@ class CursorTests(ConnectingTestCase):
self.assertEqual([(5,), (6,), (7,)], cur2.fetchall())
@skip_before_postgres(8, 0)
+ def test_named_noop_close(self):
+ cur = self.conn.cursor('test')
+ cur.close()
+
+ @skip_before_postgres(8, 0)
def test_scroll(self):
cur = self.conn.cursor()
cur.execute("select generate_series(0,9)")