Skip to content

Instantly share code, notes, and snippets.

@briggleman
Created June 19, 2019 19:56
Show Gist options
  • Save briggleman/1071d068c08c994d03e82bc606eb6261 to your computer and use it in GitHub Desktop.
Save briggleman/1071d068c08c994d03e82bc606eb6261 to your computer and use it in GitHub Desktop.
@pytest.fixture(autouse=True)
def redis(occasion):
async def get(key):
# dictionary containing compressed data
return occasion
# mocked main implementation of sanic_redis_ext.RedisExtension
with mock.patch("aioredis.Redis.get") as mocked:
mocked.side_effect = get
yield mocked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment