Skip to content

feat: add asyncio support - #851

Open
Faylixe wants to merge 8 commits into
dbfixtures:mainfrom
Faylixe:patch-1
Open

feat: add asyncio support#851
Faylixe wants to merge 8 commits into
dbfixtures:mainfrom
Faylixe:patch-1

Conversation

@Faylixe

@Faylixe Faylixe commented Aug 30, 2025

Copy link
Copy Markdown

Adding a new factory for supporting usage of async Redis client. The PR consists in:

  • Adding pytest-asyncio dependency for asynchronous support.
  • Adding a dedicated factory for async Redis client.
  • Adding test to cover async client usage.

Chore that needs to be done:

  • Add newsfragment pipenv run towncrier create [issue_number].[type].rst

Types are defined in the pyproject.toml, issue_numer either from issue tracker or the Pull request number

Faylixe and others added 3 commits August 30, 2025 17:47
Adding an new factory for supporting usage of async Redis client
@Faylixe
Faylixe marked this pull request as ready for review August 30, 2025 16:09
@Faylixe

Faylixe commented Aug 30, 2025

Copy link
Copy Markdown
Author

Resolve #852

Comment thread Pipfile Outdated
"""

@pytest.fixture
async def async_redisdb_factory(request: FixtureRequest) -> AsyncGenerator[Redis]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, As I haven't done pytest-async yet.

Do we have to have pytest-async installed in order for it to work?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what at version asyncio got introduced in redis-py?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to have pytest-async installed in order for it to work?

Well it is not mandatory but pytest-asyncio has been a standard way to use async fixtures and run async tests with Pytest.

Also, what at version asyncio got introduced in redis-py?

Very good question, I would say a long long time already. (I didn't check all the way out but commit history on redis-py has asyncio package before 2022 :)

@Faylixe
Faylixe requested a review from fizyk September 5, 2025 13:05
@Ada-lave

Copy link
Copy Markdown

is it actual for us too!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants