Add one more test for errors involving two cursors

This commit is contained in:
Jan Urbański 2010-04-11 23:12:01 +02:00 committed by Daniele Varrazzo
parent c4ebc0f702
commit f06f557111

View File

@ -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__)