Skip to content

Commit

Permalink
hi
Browse files Browse the repository at this point in the history
  • Loading branch information
dycw committed Sep 16, 2024
1 parent 5375a91 commit 29d1df6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/tests/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 29d1df6

Please sign in to comment.