Skip to content

ditto.plugin

pytest plugin hooks for snapshot lifecycle management.

pytest_unconfigure(config)

Close all backend connections after pruning has run in pytest_sessionfinish.

Source code in ditto/plugin/_hooks.py
def pytest_unconfigure(config: pytest.Config) -> None:
    """Close all backend connections after pruning has run in pytest_sessionfinish."""
    state = config.stash.get(SESSION_STATE, None)
    if state is not None:
        state.exit_stack.close()