def test_list_enclosed_type_outer_union():
    """
    As an alternative to list[T, T] one can use
    Union[list[T], list[T]]
    """

    # Outer Unionized and required
    class Settings(Dynaconf):
        colors: Union[list[str], str]

    Settings(colors=[])
    Settings(colors=["a"])
    Settings(colors="a")

    with pytest.raises(
        ValidationError,
        match="colors must is_type_of.+list",
    ):
        Settings(colors=1)
    with pytest.raises(
        ValidationError,
        match="colors is required",
    ):
        Settings()

    As an alternative to list[T, T] one can use
    Union[list[T], list[T]]
    
tests/test_typed.py