Skip to content

webserver_service_locator

Scope: function | Returns: DependencyContainer

The webserver_service_locator fixture bootstraps and sets the global service locator with the webserver's component registrations.

Info

For testing HTTP endpoints, use web_client instead — it already depends on this fixture internally. Declare webserver_service_locator directly only when you need the webserver's dependency container without going through the higher-level client fixtures.

Basic usage

@pytest.mark.usefixtures("webserver_service_locator")
def test_webserver_component():
    ...