From 1c7d53724756929e64d7fed38dd577b995ac9f8c Mon Sep 17 00:00:00 2001 From: Derek Wan Date: Mon, 16 Sep 2024 22:23:22 +0900 Subject: [PATCH] hi --- src/tests/test_redis.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tests/test_redis.py b/src/tests/test_redis.py index 488895c3c..56cf08f91 100644 --- a/src/tests/test_redis.py +++ b/src/tests/test_redis.py @@ -26,10 +26,21 @@ async def test_main(self, *, data: DataObject, value: bool) -> None: class TestYieldClient: - def test_sync(self) -> None: + def test_sync_default(self) -> None: with yield_client() as client: assert isinstance(client, redis.Redis) - async def test_async(self) -> None: + def test_sync_client(self) -> None: + with yield_client() as client1, yield_client(client=client1) as client2: + assert isinstance(client2, redis.Redis) + + async def test_async_default(self) -> None: async with yield_client_async() as client: assert isinstance(client, redis.asyncio.Redis) + + async def test_async_client(self) -> None: + async with ( + yield_client_async() as client1, + yield_client_async(client=client1) as client2, + ): + assert isinstance(client2, redis.asyncio.Redis)