diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2018-01-11 00:16:01 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2018-01-11 00:16:01 +0000 |
commit | 6da3e7ee69971cd6cb692765a4d66a5ce405f104 (patch) | |
tree | ba958560605a1b35198722e54ca38eae5397ae0e /tests | |
parent | ddef2e30cd080c21f4a52a757c642069ceb935c5 (diff) | |
parent | e0226fc46ad21f10ca612b32659bab442d2db871 (diff) | |
download | psycopg2-6da3e7ee69971cd6cb692765a4d66a5ce405f104.tar.gz |
Merge branch 'mogrify-on-closed-cursor'
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_cursor.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_cursor.py b/tests/test_cursor.py index ec76918..cc8db0f 100755 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -118,6 +118,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, |