MCPcopy
hub / github.com/redis/redis-py / test_pool_auto_close

Function test_pool_auto_close

tests/test_asyncio/test_connection.py:536–549  ·  view source on GitHub ↗

Verify that basic Redis instances have auto_close_connection_pool set to True

(request, from_url)

Source from the content-addressed store, hash-verified

534
535@pytest.mark.parametrize("from_url", (True, False), ids=("from_url", "from_args"))
536async def test_pool_auto_close(request, from_url):
537 """Verify that basic Redis instances have auto_close_connection_pool set to True"""
538
539 url: str = request.config.getoption("--redis-url")
540 url_args = parse_url(url)
541
542 async def get_redis_connection():
543 if from_url:
544 return Redis.from_url(url)
545 return Redis(**url_args)
546
547 r1 = await get_redis_connection()
548 assert r1.auto_close_connection_pool is True
549 await r1.aclose()
550
551
552async def test_close_is_aclose(request):

Callers

nothing calls this directly

Calls 3

parse_urlFunction · 0.90
get_redis_connectionFunction · 0.70
acloseMethod · 0.45

Tested by

no test coverage detected