def test_validation_alias_settings(
    config_by_alias: Union[bool, None],
    config_by_name: Union[bool, None],
    runtime_by_alias: Union[bool, None],
    runtime_by_name: Union[bool, None],
) -> None:
    """This test reflects the priority that applies for config vs runtime validation alias configuration.

    Runtime values take precedence over config values, when set.
    By default, `by_alias` is True and `by_name` is False.
    """

    if (config_by_alias is False and config_by_name is not True) or (
        runtime_by_alias is False and runtime_by_name is not True
    ):
        pytest.skip("Can't have both validate_by_alias and validate_by_name as effectively False")

    config_dict = {
        **({'validate_by_alias': config_by_alias} if config_by_alias is not None else {}),
        **({'validate_by_name': config_by_name} if config_by_name is not None else {}),
    }

    class Model(BaseModel):
        model_config = ConfigDict(**config_dict)

        my_field: int = Field(validation_alias='my_alias')

    alias_allowed = next(x for x in (runtime_by_alias, config_by_alias, True) if x is not None)
    name_allowed = next(x for x in (runtime_by_name, config_by_name, False) if x is not None)

    if alias_allowed:
        assert Model.model_validate({'my_alias': 1}, by_alias=runtime_by_alias, by_name=runtime_by_name).my_field == 1
    if name_allowed:
        assert Model.model_validate({'my_field': 1}, by_alias=runtime_by_alias, by_name=runtime_by_name).my_field == 1
This test reflects the priority that applies for config vs runtime validation alias configuration.

    Runtime values take precedence over config values, when set.
    By default, `by_alias` is True and `by_name` is False.
    
tests/test_aliases.py