MCPcopy Create free account
hub / github.com/livekit/agents / event_loop_policy

Function event_loop_policy

tests/virtual_time.py:325–334  ·  view source on GitHub ↗

Loop policy pytest-asyncio builds the test loop from. Virtual-time tests get a :class:`_VirtualTimeLoop` (autojumping virtual clock); everything else gets the default policy, i.e. exactly what pytest-asyncio would use without this override, so non-marked tests are unaffected. `real_time

(request: pytest.FixtureRequest)

Source from the content-addressed store, hash-verified

323
324@pytest.fixture
325def event_loop_policy(request: pytest.FixtureRequest) -> asyncio.AbstractEventLoopPolicy:
326 """Loop policy pytest-asyncio builds the test loop from.
327
328 Virtual-time tests get a :class:`_VirtualTimeLoop` (autojumping virtual clock); everything else
329 gets the default policy, i.e. exactly what pytest-asyncio would use without this override, so
330 non-marked tests are unaffected. `real_time` opts a test out even under a module-level mark.
331 """
332 if is_virtual_time(request.node):
333 return _VirtualTimePolicy()
334 return asyncio.DefaultEventLoopPolicy()
335
336
337@pytest.fixture(autouse=True)

Callers

nothing calls this directly

Calls 2

is_virtual_timeFunction · 0.85
_VirtualTimePolicyClass · 0.85

Tested by

no test coverage detected