MCPcopy Create free account
hub / github.com/apify/crawlee-python / http_server

Function http_server

tests/unit/conftest.py:164–168  ·  view source on GitHub ↗

Create and start an HTTP test server.

(unused_tcp_port_factory: Callable[[], int])

Source from the content-addressed store, hash-verified

162
163@pytest.fixture(scope='session')
164def http_server(unused_tcp_port_factory: Callable[[], int]) -> Iterator[TestServer]:
165 """Create and start an HTTP test server."""
166 config = Config(app=app, lifespan='off', loop='asyncio', port=unused_tcp_port_factory())
167 server = TestServer(config=config)
168 yield from serve_in_thread(server)
169
170
171@pytest.fixture(scope='session')

Callers

nothing calls this directly

Calls 2

TestServerClass · 0.90
serve_in_threadFunction · 0.90

Tested by

no test coverage detected