Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion telebot/states/asyncio/middleware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from telebot.asyncio_handler_backends import BaseMiddleware
from telebot.async_telebot import AsyncTeleBot
from telebot.states.sync.context import StateContext
from telebot.states.asyncio.context import StateContext
from telebot.util import update_types
from telebot import types

Expand Down
8 changes: 8 additions & 0 deletions tests/test_async_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ async def fake_sleep(_seconds):
assert calls["n"] == budget, (
f"Expected {budget} total attempts, got {calls['n']}"
)


def test_async_state_middleware_uses_async_context():
from telebot.states.asyncio.middleware import StateMiddleware, StateContext
from telebot.states.asyncio.context import StateContext as AsyncStateContext

assert StateContext is AsyncStateContext, "StateMiddleware must use asyncio.context.StateContext"

Loading