@@ -88,34 +88,35 @@ async def test_standalone_pipeline(delay):
8888 addr = ("localhost" , 5380 ), redis_addr = ("localhost" , 6379 ), delay = delay * 2
8989 )
9090 await dp .start ()
91- async with Redis (host = "localhost" , port = 5380 ) as r :
92- await r .set ("foo" , "foo" )
93- await r .set ("bar" , "bar" )
91+ for b in [True , False ]:
92+ async with Redis (host = "localhost" , port = 5380 , single_connection_client = b ) as r :
93+ await r .set ("foo" , "foo" )
94+ await r .set ("bar" , "bar" )
9495
95- pipe = r .pipeline ()
96+ pipe = r .pipeline ()
9697
97- pipe2 = r .pipeline ()
98- pipe2 .get ("bar" )
99- pipe2 .ping ()
100- pipe2 .get ("foo" )
98+ pipe2 = r .pipeline ()
99+ pipe2 .get ("bar" )
100+ pipe2 .ping ()
101+ pipe2 .get ("foo" )
101102
102- t = asyncio .create_task (pipe .get ("foo" ).execute ())
103- await asyncio .sleep (delay )
104- t .cancel ()
103+ t = asyncio .create_task (pipe .get ("foo" ).execute ())
104+ await asyncio .sleep (delay )
105+ t .cancel ()
105106
106- pipe .get ("bar" )
107- pipe .ping ()
108- pipe .get ("foo" )
109- pipe .reset ()
107+ pipe .get ("bar" )
108+ pipe .ping ()
109+ pipe .get ("foo" )
110+ pipe .reset ()
110111
111- assert await pipe .execute () is None
112+ assert await pipe .execute () is None
112113
113- # validating that the pipeline can be used as it could previously
114- pipe .get ("bar" )
115- pipe .ping ()
116- pipe .get ("foo" )
117- assert await pipe .execute () == [b"bar" , True , b"foo" ]
118- assert await pipe2 .execute () == [b"bar" , True , b"foo" ]
114+ # validating that the pipeline can be used as it could previously
115+ pipe .get ("bar" )
116+ pipe .ping ()
117+ pipe .get ("foo" )
118+ assert await pipe .execute () == [b"bar" , True , b"foo" ]
119+ assert await pipe2 .execute () == [b"bar" , True , b"foo" ]
119120
120121 await dp .stop ()
121122
0 commit comments