Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Add FORCE_SETTINGS_FILES to LazySettings.configure() for pytest #1077

Open
natelandau opened this issue Mar 7, 2024 · 0 comments
Open
Labels
Not a Bug Not a Problem, expected behavior RFC

Comments

@natelandau
Copy link

I am using DynaConf for loading settings for CLI scripts which are widely distributed. The TOML settings files are located in common configuration paths in the user space such as ~/.config/cli/config.toml or ~/Library/Application Support/cli/config.toml.

It is confusing to ask end-users to place their values under a an environment header such as [default]. End users will never need different environments. However, when running pytest to test my CLI there is no easy way to override the values of the settings_files configuration option.

Similar to how you can add settings.configure(FORCE_ENV_FOR_DYNACONF="testing") to force an environment to be used in testing, it would be great to have SETTINGS.configure(FORCE_SETTINGS_FILES=[path/to/settings.toml]) to override the files that are loaded. This would allow easy creation of multiple configuration files to be used in integration tests.

Maybe there is an easier way to do this, but I haven't found one yet.

@natelandau natelandau added Not a Bug Not a Problem, expected behavior RFC labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not a Bug Not a Problem, expected behavior RFC
Projects
None yet
Development

No branches or pull requests

1 participant