MCPcopy Create free account
hub / github.com/OpenPipe/ART / test_server

Function test_server

tests/unit/test_yield_trajectory.py:111–128  ·  view source on GitHub ↗

Start a test server for the module.

()

Source from the content-addressed store, hash-verified

109
110@pytest_asyncio.fixture
111async def test_server():
112 """Start a test server for the module."""
113
114 async def handler(_: web.Request) -> web.Response:
115 return web.json_response(mock_response)
116
117 app = web.Application()
118 app.router.add_route("POST", "/v1/chat/completions", handler)
119 runner = web.AppRunner(app)
120 await runner.setup()
121 site = web.TCPSite(runner, "localhost", 8888)
122 await site.start()
123 print(f"Test server started on http://localhost:8888")
124
125 yield # Tests run here
126
127 print("Cleaning up test server...")
128 await runner.cleanup()
129
130
131async def test_yield_trajectory(test_server: None) -> None:

Callers

nothing calls this directly

Calls 1

startMethod · 0.45

Tested by

no test coverage detected