@@ -79,6 +79,9 @@ def listener1(*args):
7979
8080class TestLogListeners (tb .ConnectedTestCase ):
8181
82+ @tb .with_connection_options (server_settings = {
83+ 'client_min_messages' : 'notice'
84+ })
8285 async def test_log_listener_01 (self ):
8386 q1 = asyncio .Queue (loop = self .loop )
8487
@@ -90,19 +93,23 @@ def notice_callb(con, message):
9093
9194 async def raise_notice ():
9295 await self .con .execute (
93- "DO $$ BEGIN RAISE NOTICE 'catch me!'; END; $$ LANGUAGE plpgsql"
96+ """DO $$
97+ BEGIN RAISE NOTICE 'catch me!'; END;
98+ $$ LANGUAGE plpgsql"""
9499 )
95100
96101 async def raise_warning ():
97102 await self .con .execute (
98- "DO $$ BEGIN RAISE WARNING 'catch me!'; END; $$ LANGUAGE plpgsql"
103+ """DO $$
104+ BEGIN RAISE WARNING 'catch me!'; END;
105+ $$ LANGUAGE plpgsql"""
99106 )
100107
101108 con = self .con
102109 con .add_log_listener (notice_callb )
103110
104111 expected_msg = {
105- 'context' : 'PL/pgSQL function inline_code_block line 1 at RAISE' ,
112+ 'context' : 'PL/pgSQL function inline_code_block line 2 at RAISE' ,
106113 'message' : 'catch me!' ,
107114 'server_source_filename' : 'pl_exec.c' ,
108115 'server_source_function' : 'exec_stmt_raise' ,
@@ -151,6 +158,9 @@ async def raise_warning():
151158 await raise_notice ()
152159 self .assertTrue (q1 .empty ())
153160
161+ @tb .with_connection_options (server_settings = {
162+ 'client_min_messages' : 'notice'
163+ })
154164 async def test_log_listener_02 (self ):
155165 q1 = asyncio .Queue (loop = self .loop )
156166
@@ -185,6 +195,9 @@ def notice_callb(con, message):
185195 con .remove_log_listener (notice_callb )
186196 self .assertTrue (q1 .empty ())
187197
198+ @tb .with_connection_options (server_settings = {
199+ 'client_min_messages' : 'notice'
200+ })
188201 async def test_log_listener_03 (self ):
189202 q1 = asyncio .Queue (loop = self .loop )
190203
0 commit comments