def test_debug_info_keys():
    """Test that all expected debug info keys are present with correct types"""
    @backend("markov", debug=True, system="You are a helpful assistant.")
    def generate_summary(text):
        """Generate a summary of the following text: {{ text }}"""
        return "dinosaurhead"

    result = generate_summary("Hello, world!")
    debug_info = result["_debug"]
    
    # Check all expected keys are present
    expected_keys = {
        "template": str,  # Original docstring template
        "func_name": str,  # Name of the function
        "prompt": str,    # Rendered prompt
        "system": str,    # System prompt
        "template_inputs": dict,  # Arguments used in template
        "backend_kwargs": dict,   # Backend configuration
        "datetime": str,   # ISO format datetime
        "return_type": type(None)  # None since no return type specified
    }
    
    for key, expected_type in expected_keys.items():
        assert key in debug_info, f"Missing debug key: {key}"
        assert isinstance(debug_info[key], expected_type), f"Incorrect type for {key}: expected {expected_type}, got {type(debug_info[key])}"
    
    # Check specific values
    assert debug_info["template"] == "Generate a summary of the following text: {{ text }}"
    assert debug_info["func_name"] == "generate_summary"
    assert debug_info["prompt"] == "Generate a summary of the following text: Hello, world! dinosaurhead"
    assert debug_info["system"] == "You are a helpful assistant."
    assert debug_info["template_inputs"] == {"text": "Hello, world!"}
    assert debug_info["return_type"] is None
Test that all expected debug info keys are present with correct types
tests/test_basic.py