def METHOD_NAME():
    """Check that weird override cases get caught."""
    class OverrideTestClass(Serializable['OverrideTestClass']):
        overridden_value = String("overridden_value", override=True)
        overridden_option = Optional(String(), "overridden_option", override=True)
    with pytest.raises(AttributeError, match="overridden_value"):
        OverrideTestClass.build(data={"overridden_value": "string"})
    obj = OverrideTestClass()
    with pytest.raises(AttributeError, match="overridden_value"):
        obj.overridden_value = "1"
    with pytest.raises(AttributeError, match="overridden_option"):
        obj.overridden_option = "1"
    with pytest.raises(AttributeError, match="overridden_value"):
        _ = obj.overridden_value