diff --git a/tests/test_async.py b/tests/test_async.py index 08113c4f..b51429f6 100755 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -429,6 +429,9 @@ class AsyncTests(unittest.TestCase): def test_notices(self): del self.conn.notices[:] cur = self.conn.cursor() + if self.conn.server_version >= 90300: + cur.execute("set client_min_messages=debug1") + self.wait(cur) cur.execute("create temp table chatty (id serial primary key);") self.wait(cur) self.assertEqual("CREATE TABLE", cur.statusmessage) diff --git a/tests/test_connection.py b/tests/test_connection.py index e4b7d83c..b3488f0d 100755 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -79,6 +79,8 @@ class ConnectionTests(unittest.TestCase): def test_notices(self): conn = self.conn cur = conn.cursor() + if self.conn.server_version >= 90300: + cur.execute("set client_min_messages=debug1") cur.execute("create temp table chatty (id serial primary key);") self.assertEqual("CREATE TABLE", cur.statusmessage) self.assert_(conn.notices) @@ -86,6 +88,8 @@ class ConnectionTests(unittest.TestCase): def test_notices_consistent_order(self): conn = self.conn cur = conn.cursor() + if self.conn.server_version >= 90300: + cur.execute("set client_min_messages=debug1") cur.execute("create temp table table1 (id serial); create temp table table2 (id serial);") cur.execute("create temp table table3 (id serial); create temp table table4 (id serial);") self.assertEqual(4, len(conn.notices)) @@ -97,6 +101,8 @@ class ConnectionTests(unittest.TestCase): def test_notices_limited(self): conn = self.conn cur = conn.cursor() + if self.conn.server_version >= 90300: + cur.execute("set client_min_messages=debug1") for i in range(0, 100, 10): sql = " ".join(["create temp table table%d (id serial);" % j for j in range(i, i+10)]) cur.execute(sql)