"""Reload-based tests to execute module-level initialization paths under coverage."""

from __future__ import annotations

import importlib


def test_reload_core_modules_executes_module_level_code() -> None:
    import llmdebug.config as config_module
    import llmdebug.git_context as git_context_module
    import llmdebug.hooks as hooks_module
    import llmdebug.log_capture as log_capture_module
    import llmdebug.output as output_module
    import llmdebug.redaction_policy as redaction_policy_module
    import llmdebug.serialize as serialize_module

    importlib.reload(config_module)
    importlib.reload(redaction_policy_module)
    importlib.reload(hooks_module)
    importlib.reload(log_capture_module)
    importlib.reload(output_module)
    importlib.reload(serialize_module)
    importlib.reload(git_context_module)

    assert config_module.SnapshotConfig
    assert redaction_policy_module.PII_PATTERNS
    assert hooks_module.PII_PATTERNS
    assert log_capture_module.LLMDebugLogHandler
    assert output_module.write_bundle
    assert serialize_module.serialize_locals
    assert git_context_module.get_git_context
