Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fakeredis.aioredis.FakeRedis to support version selection #205

Closed
steve-mavens opened this issue Jul 3, 2023 · 1 comment · Fixed by #206
Closed

fakeredis.aioredis.FakeRedis to support version selection #205

steve-mavens opened this issue Jul 3, 2023 · 1 comment · Fixed by #206
Labels
enhancement New feature or request

Comments

@steve-mavens
Copy link

Is your feature request related to a problem? Please describe.

I'm still using Redis 6, so it would be useful to run tests in Redis 6 compatibility mode. This is supported for the blocking client, but doesn't work for the asyncio client:

>       async with fakeredis.aioredis.FakeRedis(decode_responses=True, version=6) as client:

tests\test_redis_client.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

...SNIPPED...

>       super().__init__(
            db=db,
            password=password,
            socket_timeout=socket_timeout,
            connection_pool=connection_pool,
            encoding=encoding,
            encoding_errors=encoding_errors,
            decode_responses=decode_responses,
            retry_on_timeout=retry_on_timeout,
            max_connections=max_connections,
            health_check_interval=health_check_interval,
            client_name=client_name,
            username=username,
            **kwargs,
        )
E       TypeError: Redis.__init__() got an unexpected keyword argument 'version'

\Lib\site-packages\fakeredis\aioredis.py:230: TypeError

Describe the solution you'd like

fakeredis.aioredis.FakeRedis to support the same version parameter as fakeredis.FakeRedis

Describe alternatives you've considered

redislite, testing against real redis instance. These are sub-optimal for the same reasons fakeredis in general is good.

@steve-mavens steve-mavens added the enhancement New feature or request label Jul 3, 2023
cunla added a commit that referenced this issue Jul 3, 2023
@cunla cunla closed this as completed in #206 Jul 3, 2023
cunla added a commit that referenced this issue Jul 3, 2023
* fix:add support for version argument
* doc:update documentation script

fix #205
@steve-mavens
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant