The test fails because we receive a notification:
message type 0x33 arrived from server while idle
See issue #314.
conn.execute("select 1")
+def test_message_0x33(conn):
+ notices = []
+ conn.add_notice_handler(lambda diag: notices.append(diag.message_primary))
+
+ conn.autocommit = True
+ with conn.pipeline():
+ cur = conn.execute("select 'test'")
+ cur.fetchone() == ("test",)
+
+ assert not notices
+
+
def test_concurrency(conn):
with conn.transaction():
conn.execute("drop table if exists pipeline_concurrency")
await aconn.execute("select 1")
+async def test_message_0x33(aconn):
+ notices = []
+ aconn.add_notice_handler(lambda diag: notices.append(diag.message_primary))
+
+ await aconn.set_autocommit(True)
+ async with aconn.pipeline():
+ cur = await aconn.execute("select 'test'")
+ await cur.fetchone() == ("test",)
+
+ assert not notices
+
+
async def test_concurrency(aconn):
async with aconn.transaction():
await aconn.execute("drop table if exists pipeline_concurrency")