mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix Sqlite tests
This commit is contained in:
parent
12e04cd2cf
commit
886ec0f133
2 changed files with 4 additions and 4 deletions
|
|
@ -32,10 +32,10 @@ class SqliteStorage(BaseStorage):
|
|||
if key_builder is None:
|
||||
key_builder = DefaultKeyBuilder()
|
||||
self._key_builder = key_builder
|
||||
self.connection = connection
|
||||
self._connection = connection
|
||||
|
||||
@classmethod
|
||||
async def connect(cls, db_filename: str = SQLITE_FILENAME) -> Connection:
|
||||
async def connect(cls, db_filename: str = SQLITE_FILENAME) -> "SqliteStorage":
|
||||
"""
|
||||
Create an instance of :class:`SqliteStorage` with specifying the DB filename
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ class SqliteStorage(BaseStorage):
|
|||
return cls(connection=connection)
|
||||
|
||||
async def close(self) -> None:
|
||||
await self.connection.close()
|
||||
await self._connection.close()
|
||||
|
||||
async def set_state(self, key: StorageKey, state: StateType = None) -> None:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ async def memory_storage():
|
|||
|
||||
@pytest.fixture()
|
||||
async def squlite_storage():
|
||||
storage = SqliteStorage()
|
||||
storage = SqliteStorage.connect("aiogram_fsm_test.sqlite")
|
||||
try:
|
||||
yield storage
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue