Collects garbage and checks that this closes what was dropped, so that it means something if the rest is open.
(client: Anthropic)
| 277 | |
| 278 | |
| 279 | def collect(client: Anthropic) -> None: |
| 280 | """Collects garbage and checks that this closes what was dropped, so that it means something if the rest is open.""" |
| 281 | dropped = Body() |
| 282 | stream = requester(client, dropped)() |
| 283 | next(stream) |
| 284 | in_a_cycle(stream) |
| 285 | del stream |
| 286 | gc.collect() |
| 287 | assert dropped.closes == 1 |
| 288 | |
| 289 | |
| 290 | async def async_collect(client: AsyncAnthropic) -> None: |