Skip to content

limefu_service_locator

Scope: function | Returns: DependencyContainer

The limefu_service_locator fixture bootstraps and sets the global service locator with limefu's component registrations. Use it in tests that exercise limefu commands.

Basic usage

@pytest.mark.usefixtures("limefu_service_locator")
def test_limefu_command():
    ...

When every test in a module exercises limefu commands, apply it once via an autouse fixture in conftest.py:

@pytest.fixture(autouse=True)
def set_service_locator_for_limefu(limefu_service_locator):
    return limefu_service_locator