def test_read_file_syntax_error(tmp_path):
    """Assert read_file converter raises error on invalid syntax"""
    # 1. Create a settings file with the read_file converter
    settings_file = tmp_path / "settings.toml"
    create_file(
        settings_file,
        """\
        SECRET_KEY = "@read_file "
        """,
    )
    # 2. Load the settings
    with pytest.raises(DynaconfFormatError):
        settings = Dynaconf(
            settings_file=settings_file,
        )
        settings.SECRET_KEY
Assert read_file converter raises error on invalid syntax
tests/test_utils.py