supercontest.util.config
Utilities around config management.
Functions
Takes a config file that does not have sections (headers) and returns the content anyway. |
- supercontest.util.config.get_sectionless_config(path: str) dict[Any, Any]
Takes a config file that does not have sections (headers) and returns the content anyway.
The reason this function is necessary: The database config files are passed both (1) as
env_filein docker compose and (2) as configparser inputs (ini style) increate_app(). Env files cannot have section headers. Ini files must have section headers.So we keep the raw files sectionless. Docker reads them directly. The
create_app()function uses this to inject fake section headers.Note also that because ConfigParser mimics ini, and ini is case-insensitive, we cast to strings here to maintain the casing in the raw files.
- Parameters:
path – Path to the config to be read.
- Returns:
The key/val pairs from the config.