Skip to content

Commit

Permalink
Enable testing with FakeConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Mar 15, 2023
1 parent 0e11e7d commit bbed2f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fakeredis/aioredis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import async_timeout
import redis.asyncio as redis_async # aioredis was integrated into redis in version 4.2.0 as redis.asyncio

from . import _fakesocket
from . import _fakesocket, FakeServer
from . import _helpers
from . import _msgs as msgs
from . import _server
Expand Down Expand Up @@ -100,7 +100,9 @@ def writelines(self, data):

class FakeConnection(redis_async.Connection):
def __init__(self, *args, **kwargs):
self._server = kwargs.pop('server')
self._server = kwargs.pop('server', None)
if self._server is None:
self._server = FakeServer()
self._sock = None
super().__init__(*args, **kwargs)

Expand Down

0 comments on commit bbed2f2

Please sign in to comment.