From 501a345aed4c661df8f3c18b2235ec76efce3946 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 8 Oct 2026 11:01:08 -0400 Subject: [PATCH] test(snmp): read and remove the poll test's rows in one transaction (milestone 491) Run 8790: a select opened the session's transaction before begin(). Co-Authored-By: Claude Opus 5.5 --- tests/integration/test_snmp_poll.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_snmp_poll.py b/tests/integration/test_snmp_poll.py index f5d42e4..d33d941 100644 --- a/tests/integration/test_snmp_poll.py +++ b/tests/integration/test_snmp_poll.py @@ -65,9 +65,9 @@ def test_a_poll_records_why_a_device_is_silent_and_what_another_answered(app): await asyncio.sleep(1.1) await scheduler._do_poll(app, poll=fake_poll) async with app.db_sessionmaker() as s: - rows = {d.name: d for d in (await s.execute( - select(SnmpDevice).where(SnmpDevice.name.in_([up, down])))).scalars()} async with s.begin(): + rows = {d.name: d for d in (await s.execute( + select(SnmpDevice).where(SnmpDevice.name.in_([up, down])))).scalars()} for d in rows.values(): await s.delete(d) return first, await _latest(app, up), rows