@@ -151,6 +151,8 @@ def test_init_unique_system_id(self):
151151 self .assertGreater (id2 , id1 )
152152
153153 def test_node_exit (self ):
154+ base_dir = None
155+
154156 with self .assertRaises (QueryException ):
155157 with get_new_node ().init () as node :
156158 base_dir = node .base_dir
@@ -252,27 +254,27 @@ def test_psql(self):
252254
253255 # check returned values (1 arg)
254256 res = node .psql ('select 1' )
255- self .assertEqual ((0 , b'1\n ' , b'' ), res )
257+ self .assertEqual (res , (0 , b'1\n ' , b'' ))
256258
257259 # check returned values (2 args)
258260 res = node .psql ('postgres' , 'select 2' )
259- self .assertEqual ((0 , b'2\n ' , b'' ), res )
261+ self .assertEqual (res , (0 , b'2\n ' , b'' ))
260262
261263 # check returned values (named)
262264 res = node .psql (query = 'select 3' , dbname = 'postgres' )
263- self .assertEqual ((0 , b'3\n ' , b'' ), res )
265+ self .assertEqual (res , (0 , b'3\n ' , b'' ))
264266
265267 # check returned values (1 arg)
266268 res = node .safe_psql ('select 4' )
267- self .assertEqual (b'4\n ' , res )
269+ self .assertEqual (res , b'4\n ' )
268270
269271 # check returned values (2 args)
270272 res = node .safe_psql ('postgres' , 'select 5' )
271- self .assertEqual (b'5\n ' , res )
273+ self .assertEqual (res , b'5\n ' )
272274
273275 # check returned values (named)
274276 res = node .safe_psql (query = 'select 6' , dbname = 'postgres' )
275- self .assertEqual (b'6\n ' , res )
277+ self .assertEqual (res , b'6\n ' )
276278
277279 # check feeding input
278280 node .safe_psql ('create table horns (w int)' )
@@ -612,7 +614,7 @@ def test_users(self):
612614 with get_new_node ().init ().start () as node :
613615 node .psql ('create role test_user login' )
614616 value = node .safe_psql ('select 1' , username = 'test_user' )
615- self .assertEqual (b'1\n ' , value )
617+ self .assertEqual (value , b'1\n ' )
616618
617619 def test_poll_query_until (self ):
618620 with get_new_node () as node :
0 commit comments