mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Add one more test for errors involving two cursors
This commit is contained in:
parent
c4ebc0f702
commit
f06f557111
|
@ -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__)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user