diff options
author | Jan UrbaĆski <wulczer@wulczer.org> | 2010-04-11 23:12:01 +0200 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-04-20 23:01:10 +0100 |
commit | f06f5571119f3bc2b9b1c51a0448b208fd76bad7 (patch) | |
tree | f29800a3d78dd06b20ae7eaa5b532d061c0e72a0 /tests/test_async.py | |
parent | c4ebc0f702dfc3bae92ff3ffc01b9d6ed5d2fbde (diff) | |
download | psycopg2-f06f5571119f3bc2b9b1c51a0448b208fd76bad7.tar.gz |
Add one more test for errors involving two cursors
Diffstat (limited to 'tests/test_async.py')
-rwxr-xr-x | tests/test_async.py | 9 |
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__) |