Skip to content

Commit 85bb987

Browse files
Assert fetchmany clears the cursor messages at the call boundary
The test appended a sentinel to cur.messages but never checked it was cleared, so removing the prelude clear would not have failed it. Assert the sentinel is gone and messages is empty after the call. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d6b004f commit 85bb987

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tests/test_fetchmany_one_clear_per_call_pep249.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def test_sync_fetchmany_clears_messages_only_once() -> None:
1919
cur.messages.append(("Warning", "sentinel")) # type: ignore[arg-type]
2020
more = cur.fetchmany(2)
2121
assert len(more) == 2
22-
# The sentinel is wiped by the prelude clear (correct); the real pin is structural below.
22+
assert ("Warning", "sentinel") not in cur.messages
23+
assert cur.messages == []
2324
finally:
2425
conn.close()
2526

0 commit comments

Comments
 (0)