Collects garbage and checks that this closes what was dropped, so that it means something if the rest is open.
(client: Anthropic)
| 295 | |
| 296 | |
| 297 | def collect(client: Anthropic) -> None: |
| 298 | """Collects garbage and checks that this closes what was dropped, so that it means something if the rest is open.""" |
| 299 | dropped = Body() |
| 300 | stream = requester(client, dropped)() |
| 301 | next(stream) |
| 302 | in_a_cycle(stream) |
| 303 | del stream |
| 304 | gc.collect() |
| 305 | assert dropped.closes == 1 |
| 306 | |
| 307 | |
| 308 | async def async_collect(client: AsyncAnthropic) -> None: |