MCPcopy
hub / github.com/python-trio/trio / test_CapacityLimiter_inf

Function test_CapacityLimiter_inf

src/trio/_tests/test_sync.py:123–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121
122
123async 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
139async def test_CapacityLimiter_change_total_tokens() -> None:

Callers

nothing calls this directly

Calls 3

releaseMethod · 0.95
acquire_nowaitMethod · 0.95
CapacityLimiterClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…