()
| 121 | |
| 122 | |
| 123 | async def test_CapacityLimiter_inf() -> None: |
| 124 | from math import inf |
| 125 | |
| 126 | c = CapacityLimiter(inf) |
| 127 | repr(c) # smoke test |
| 128 | assert c.total_tokens == inf |
| 129 | assert c.borrowed_tokens == 0 |
| 130 | assert c.available_tokens == inf |
| 131 | with pytest.raises(RuntimeError): |
| 132 | c.release() |
| 133 | assert c.borrowed_tokens == 0 |
| 134 | c.acquire_nowait() |
| 135 | assert c.borrowed_tokens == 1 |
| 136 | assert c.available_tokens == inf |
| 137 | |
| 138 | |
| 139 | async def test_CapacityLimiter_change_total_tokens() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…