{"library":"looptime","title":"looptime","description":"Utility to fast-forward asyncio event loop time for deterministic testing. Current version 0.7, requires Python >=3.10. Released as a standalone package to replace pytest-asyncio's `loop_context` for controlling virtual time.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install looptime"],"cli":null},"imports":["from looptime import Looper"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import asyncio\nfrom looptime import Looper\n\nasync def test_sleep():\n    looper = Looper()\n    asyncio.get_event_loop().run_until_complete(looper.__aenter__())\n    await asyncio.sleep(3600)\n    # Without looper, this would block for an hour.\n    looper.advance(3600)\n    # Now the sleep completes immediately.\n    await looper.__aexit__(None, None, None)","lang":"python","description":"Basic usage: create a Looper, enter it as a context manager, advance time, and exit.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}