def METHOD_NAME(
    config_class: Type[ConfigModel],
    config_dict: Dict[str, Any],
    expected: Optional[ConfigModel],
    raises_exception: bool,
) -> None:
    if raises_exception:
        with pytest.raises(ValidationError):
            assert expected is None
            config_class.parse_obj_allow_extras(config_dict)
    else:
        config = config_class.parse_obj_allow_extras(config_dict)
        assert config == expected