refactor: govern background job execution

This commit is contained in:
leefer
2026-07-29 19:57:31 +08:00
parent 02af8488b3
commit 5f0b9735bd
15 changed files with 520 additions and 52 deletions
+5 -2
View File
@@ -20,14 +20,17 @@ class DatabaseMigrationTests(unittest.TestCase):
).fetchall()
self.assertEqual(
[(row["version"], row["name"]) for row in rows],
[("0001", "adopt_legacy_schema")],
[
("0001", "adopt_legacy_schema"),
("0002", "create_job_runs"),
],
)
ReviewDatabase(path)
with database.connect() as connection:
count = connection.execute(
"SELECT COUNT(*) AS count FROM schema_migrations"
).fetchone()["count"]
self.assertEqual(count, 1)
self.assertEqual(count, 2)
def test_connection_factory_enables_required_pragmas(self) -> None:
with tempfile.TemporaryDirectory() as root: