MCPcopy
hub / github.com/encode/httpx / serve_in_thread

Function serve_in_thread

tests/conftest.py:271–280  ·  view source on GitHub ↗
(server: TestServer)

Source from the content-addressed store, hash-verified

269
270
271def serve_in_thread(server: TestServer) -> typing.Iterator[TestServer]:
272 thread = threading.Thread(target=server.run)
273 thread.start()
274 try:
275 while not server.started:
276 time.sleep(1e-3)
277 yield server
278 finally:
279 server.should_exit = True
280 thread.join()
281
282
283@pytest.fixture(scope="session")

Callers 1

serverFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected