def test_apply_overwrites_does_include_unused_variables(template_context) -> None:
    """Verify `apply_overwrites_to_context` skips variables that are not in context."""
    generate.apply_overwrites_to_context(
        context=template_context, overwrite_context={'not in template': 'foobar'}
    )

    assert 'not in template' not in template_context
Verify `apply_overwrites_to_context` skips variables that are not in context.
tests/test_generate_context.py