mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Removed the use of the context instance (Bot.get_current) from all placements that were used previously. (#1230)
* Removed the use of the context instance (Bot.get_current) from all placements that were used previously. * Fixed tests * Added changelog * Change category
This commit is contained in:
parent
479e302cba
commit
2ecf9cefd7
11 changed files with 45 additions and 49 deletions
|
|
@ -4,7 +4,7 @@ import pytest
|
|||
from _pytest.config import UsageError
|
||||
from redis.asyncio.connection import parse_url as parse_redis_url
|
||||
|
||||
from aiogram import Bot, Dispatcher
|
||||
from aiogram import Dispatcher
|
||||
from aiogram.fsm.storage.memory import (
|
||||
DisabledEventIsolation,
|
||||
MemoryStorage,
|
||||
|
|
@ -109,12 +109,7 @@ async def disabled_isolation():
|
|||
|
||||
@pytest.fixture()
|
||||
def bot():
|
||||
bot = MockedBot()
|
||||
token = Bot.set_current(bot)
|
||||
try:
|
||||
yield bot
|
||||
finally:
|
||||
Bot.reset_current(token)
|
||||
return MockedBot()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue