test(syslog): each integration step its own session (#5999)
CI / lint (push) Successful in 2s
CI / unit (push) Successful in 1m29s
CI / integration (push) Successful in 1m34s
CI / publish (push) Successful in 1m12s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-18 23:15:13 -04:00
co-authored by Claude Opus 5.5
parent 6ff9cffed4
commit bf6019a2af
+2
View File
@@ -64,6 +64,7 @@ def test_an_unknown_sender_is_offered_and_an_added_one_kept(app):
lines = (await s.execute(select(SyslogLine))).scalars().all()
assert [(ln.app, ln.hostname, ln.message, ln.severity) for ln in lines] == [("kernel", "synnas", "kept", 3)]
assert (await s.get(SyslogSource, src_id)).lines_total == 3
async with app.db_sessionmaker() as s:
async with s.begin():
await s.execute(delete(SyslogSource))
@@ -102,6 +103,7 @@ def test_the_ring_keeps_each_source_within_its_window_and_cap(app):
kept = (await s.execute(select(SyslogLine.source_id))).scalars().all()
assert counts == {"age_pruned": 1, "size_pruned": 2}
assert kept.count(a_id) == 3 and kept.count(b_id) == 2
async with app.db_sessionmaker() as s:
async with s.begin():
await s.execute(delete(SyslogSource))