summaryrefslogtreecommitdiff
path: root/tests/test_async.py
diff options
context:
space:
mode:
authorJan UrbaƄski <wulczer@wulczer.org>2010-04-11 23:12:01 +0200
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-20 23:01:10 +0100
commitf06f5571119f3bc2b9b1c51a0448b208fd76bad7 (patch)
treef29800a3d78dd06b20ae7eaa5b532d061c0e72a0 /tests/test_async.py
parentc4ebc0f702dfc3bae92ff3ffc01b9d6ed5d2fbde (diff)
downloadpsycopg2-f06f5571119f3bc2b9b1c51a0448b208fd76bad7.tar.gz
Add one more test for errors involving two cursors
Diffstat (limited to 'tests/test_async.py')
-rwxr-xr-xtests/test_async.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_async.py b/tests/test_async.py
index bc23ab7..91a5392 100755
--- a/tests/test_async.py
+++ b/tests/test_async.py
@@ -361,6 +361,15 @@ class AsyncTests(unittest.TestCase):
cur.execute("delete from table1")
self.wait(cur)
+ def test_error_two_cursors(self):
+ cur = self.conn.cursor()
+ cur2 = self.conn.cursor()
+ cur.execute("select * from no_such_table")
+ self.assertRaises(psycopg2.ProgrammingError, self.wait, cur)
+ cur2.execute("select 1")
+ self.wait(cur2)
+ self.assertEquals(cur2.fetchone()[0], 1)
+
def test_suite():
return unittest.TestLoader().loadTestsFromName(__name__)