Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit ebbe0da

Browse files
committed
Lint
1 parent 312ec60 commit ebbe0da

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

synapse/storage/engines/sqlite.py

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def on_new_connection(self, db_conn: "LoggingDatabaseConnection") -> None:
8686

8787
if self._is_in_memory:
8888
if self._prepped_conn is not None:
89+
assert isinstance(db_conn.conn, sqlite3.Connection)
8990
self._prepped_conn.backup(db_conn.conn)
9091
else:
9192
# In memory databases need to be rebuilt each time. Ideally we'd

tests/server.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import logging
1717
import os
1818
import os.path
19+
import sqlite3
1920
import time
2021
import uuid
2122
import warnings
@@ -106,6 +107,8 @@
106107
# the type of thing that can be passed into `make_request` in the headers list
107108
CustomHeaderType = Tuple[Union[str, bytes], Union[str, bytes]]
108109

110+
PREPPED_DB_CONN: Optional[LoggingDatabaseConnection] = None
111+
109112

110113
class TimedOutException(Exception):
111114
"""
@@ -832,11 +835,6 @@ class TestHomeServer(HomeServer):
832835
DATASTORE_CLASS = DataStore # type: ignore[assignment]
833836

834837

835-
import sqlite3
836-
837-
PREPPED_DB_CONN = None
838-
839-
840838
def setup_test_homeserver(
841839
cleanup_func: Callable[[Callable[[], None]], None],
842840
name: str = "test",

0 commit comments

Comments
 (0)