Skip to content

Commit

Permalink
Small changes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JrooTJunior committed Jun 14, 2021
1 parent 7f0a9d8 commit 5296724
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ async def memory_storage():
def bot():
bot = MockedBot()
token = Bot.set_current(bot)
yield bot
Bot.reset_current(token)
bot.me.invalidate(bot)
try:
yield bot
finally:
Bot.reset_current(token)
bot.me.invalidate(bot)
4 changes: 4 additions & 0 deletions tests/test_dispatcher/test_fsm/storage/test_storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ async def test_update_data(self, bot: MockedBot, storage: BaseStorage):
assert await storage.update_data(
bot=bot, chat_id=-42, user_id=42, data={"baz": "spam"}
) == {"foo": "bar", "baz": "spam"}
assert await storage.get_data(bot=bot, chat_id=-42, user_id=42) == {
"foo": "bar",
"baz": "spam",
}

0 comments on commit 5296724

Please sign in to comment.