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