summaryrefslogtreecommitdiff
path: root/tests/test_async.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-01-03 21:43:02 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-01-03 21:43:02 +0100
commit80bd6e27946ed5b56b01687913369d6c895598cb (patch)
tree70f67cdc4c4e73a6e8ac7f4862d3d0b02a1ab99b /tests/test_async.py
parenta01700d478765e8dc6044336f21fe84808569a0d (diff)
parent627df159958330b54011e378427275b0494be013 (diff)
downloadpsycopg2-80bd6e27946ed5b56b01687913369d6c895598cb.tar.gz
Merge branch 'python2' into python3
Conflicts: NEWS-2.3 psycopg/connection_type.c tests/test_connection.py tests/types_basic.py
Diffstat (limited to 'tests/test_async.py')
-rwxr-xr-xtests/test_async.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_async.py b/tests/test_async.py
index be4a1d8..8c25177 100755
--- a/tests/test_async.py
+++ b/tests/test_async.py
@@ -410,6 +410,18 @@ class AsyncTests(unittest.TestCase):
self.assertEqual("CREATE TABLE", cur.statusmessage)
self.assert_(self.conn.notices)
+ def test_async_cursor_gone(self):
+ cur = self.conn.cursor()
+ cur.execute("select 42;");
+ del cur
+ self.assertRaises(psycopg2.InterfaceError, self.wait, self.conn)
+
+ # The connection is still usable
+ cur = self.conn.cursor()
+ cur.execute("select 42;");
+ self.wait(self.conn)
+ self.assertEqual(cur.fetchone(), (42,))
+
def test_suite():
return unittest.TestLoader().loadTestsFromName(__name__)