summaryrefslogtreecommitdiff
path: root/tests/test_async.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-20 17:52:05 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-04-21 15:09:14 +0100
commit12ef826d500b2f9bda97032ffa58eb53036272db (patch)
tree1b6d6353d32b57d875817c1908c4dabb418e4ade /tests/test_async.py
parentbcfcea4b49d3e1b342d4f8b8f861b2b418f96d97 (diff)
downloadpsycopg2-12ef826d500b2f9bda97032ffa58eb53036272db.tar.gz
Dropped redundant call to conn_notice_process().
If the connection is sync, notices will be processed by pq_fetch() downstream. If the connection is async, here we have only sent the query: no result is ready yet, and neither notices have had a chance to arrive: they will be retrieved later by pq_is_busy(). Added tests to check the above statement don't break.
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 6f3ec4c..a4a11b9 100755
--- a/tests/test_async.py
+++ b/tests/test_async.py
@@ -388,6 +388,15 @@ class AsyncTests(unittest.TestCase):
self.wait(cur2)
self.assertEquals(cur2.fetchone()[0], 1)
+ def test_notices(self):
+ del self.conn.notices[:]
+ cur = self.conn.cursor()
+ cur.execute("create temp table chatty (id serial primary key);")
+ self.wait(cur)
+ self.assertEqual("CREATE TABLE", cur.statusmessage)
+ self.assert_(self.conn.notices)
+
+
def test_suite():
return unittest.TestLoader().loadTestsFromName(__name__)