File: conftest.py

package info (click to toggle)
aiocache 0.12.3-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 692 kB
  • sloc: python: 5,044; makefile: 221; sh: 7
file content (17 lines) | stat: -rw-r--r-- 450 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from aiocache import Cache


@pytest.fixture
async def redis_cache():
    # redis connection pool raises ConnectionError but doesn't wait for conn reuse
    #  when exceeding max pool size.
    async with Cache(Cache.REDIS, namespace="test", pool_max_size=1) as cache:
        yield cache


@pytest.fixture
async def memcached_cache():
    async with Cache(Cache.MEMCACHED, namespace="test", pool_size=1) as cache:
        yield cache