From bf6019a2af4486266a19eba7ca2f9cf3c00a3d24 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 18 Oct 2026 23:15:13 -0400 Subject: [PATCH] test(syslog): each integration step its own session (#5999) Co-Authored-By: Claude Opus 5.5 --- tests/integration/test_syslog.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/test_syslog.py b/tests/integration/test_syslog.py index 2ef5a30..2c45490 100644 --- a/tests/integration/test_syslog.py +++ b/tests/integration/test_syslog.py @@ -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))