def test_envless_load_file(tmpdir):
    """Ensure passing settings.load_file accepts env argument.

    settings.load_file("filename.toml", env="development")
    will load the default + development env.

    settings.load_file("filename.toml", env=False|None)
    will load in envless mode.

    settings.load_file("filename.toml")
    will respect the current env settings (normal mode).
    """
    data = {
        "default": {"a_default": "From default env"},
        "development": {"value": "From development env"},
    }
    toml_path = str(tmpdir.join("base_settings.toml"))
    toml_loader.write(toml_path, data, merge=False)

    data = {
        "development": {"another_value": "Another development env"},
    }
    toml_path2 = str(tmpdir.join("base_settings2.toml"))
    toml_loader.write(toml_path2, data, merge=False)

    data = {"value": "Envless value"}
    toml_path_envless = str(tmpdir.join("base_settings_envless.toml"))
    toml_loader.write(toml_path_envless, data, merge=False)

    settings = Dynaconf(
        environments=["development", "other"], settings_file=toml_path
    )
    assert settings.VALUE == "From development env"
    assert settings.A_DEFAULT == "From default env"

    # load the env file normal way (respecting current env)
    settings.load_file(toml_path2)
    assert settings.ANOTHER_VALUE == "Another development env"

    # load the envless file
    settings.load_file(toml_path_envless, env=False)
    assert settings.VALUE == "Envless value"
Ensure passing settings.load_file accepts env argument.

    settings.load_file("filename.toml", env="development")
    will load the default + development env.

    settings.load_file("filename.toml", env=False|None)
    will load in envless mode.

    settings.load_file("filename.toml")
    will respect the current env settings (normal mode).
    
tests/test_base.py