Applied Ruff formatting fixes to storage module and tests.
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (Python 3.12) (push) Successful in 12s
CI / Tests (Python 3.13) (push) Successful in 12s
CI / Tests (Python 3.14) (push) Successful in 9s
CI / Type Checking (push) Successful in 10s
CI / Spelling (push) Successful in 5s
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (Python 3.12) (push) Successful in 12s
CI / Tests (Python 3.13) (push) Successful in 12s
CI / Tests (Python 3.14) (push) Successful in 9s
CI / Type Checking (push) Successful in 10s
CI / Spelling (push) Successful in 5s
This commit is contained in:
@@ -61,9 +61,7 @@ class ModuleStorage:
|
|||||||
:param module_name: Name of the module this storage belongs to.
|
:param module_name: Name of the module this storage belongs to.
|
||||||
"""
|
"""
|
||||||
self._db_path: Path | str = (
|
self._db_path: Path | str = (
|
||||||
storage_dir / f"{module_name}.db"
|
storage_dir / f"{module_name}.db" if storage_dir is not None else ":memory:"
|
||||||
if storage_dir is not None
|
|
||||||
else ":memory:"
|
|
||||||
)
|
)
|
||||||
self._module_name = module_name
|
self._module_name = module_name
|
||||||
self._conn: aiosqlite.Connection | None = None
|
self._conn: aiosqlite.Connection | None = None
|
||||||
|
|||||||
@@ -194,9 +194,7 @@ class TestAutoCommit:
|
|||||||
await storage_with_table.execute(
|
await storage_with_table.execute(
|
||||||
"INSERT INTO items (name, value) VALUES (?, ?)", ("a", 1)
|
"INSERT INTO items (name, value) VALUES (?, ?)", ("a", 1)
|
||||||
)
|
)
|
||||||
row = await storage_with_table.fetch_one(
|
row = await storage_with_table.fetch_one("SELECT name FROM items WHERE id = 1")
|
||||||
"SELECT name FROM items WHERE id = 1"
|
|
||||||
)
|
|
||||||
assert row is not None
|
assert row is not None
|
||||||
assert row["name"] == "a"
|
assert row["name"] == "a"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user