Commit 28be4b8
committed
Fix refcount test failing under pytest assertion rewriting
test_iterator_callback_no_leak fails on Python 3.11 in CI: pytest's
assertion rewriting explodes the assert expression into frame
temporaries, and one of them holds backend.cache[0] while
sys.getrefcount runs, inflating the count from 2 to 3. On 3.14 the
temporary does not survive, so the test passes there.
Keep the getrefcount call out of the assert so no rewritten temporary
can hold the object.
Assisted-by: Kimi Code1 parent 007c562 commit 28be4b8
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
0 commit comments