Skip to content

Commit e3dd0b4

Browse files
committed
feat(DEVC-1286): a bit rewrite test for test_cache_connection_limit
1 parent 1883c32 commit e3dd0b4

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

tests/unit/test_scheduled_app.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -518,16 +518,13 @@ def test_cache_connection_limit(requests_mock: RequestsMocker, context):
518518

519519
@scheduled
520520
def scheduled_app(event, api, cache):
521-
"""
522-
try to open additional connection to cache
523-
"""
524521
pool = cache.cache_repo.client.connection_pool
525-
# save existing connections
526-
pool._in_use_connections = pool._available_connections
527-
pool._available_connections = []
528-
# try to init new connection, this line should fail with redis
529-
# ConnectionError exception
530-
pool.get_connection("_")
522+
523+
# unique single conn
524+
pool.get_connection()
525+
526+
# Should be an error here since `max_connections=1` is passed to a Redis client
527+
pool.get_connection()
531528

532529
requests_mock.post(requests_mock_lib.ANY)
533530

0 commit comments

Comments
 (0)