def load_system_configs(self, force=False): if self.initialized_with_env and not force: return # first, let read from files system_config_store = read_from_config_files(_default_configuration_paths()) # now we can merge with environment values system_config_store.update(read_environ_config()) # all configs will be added as one layer called 'system' self.set_values(system_config_store, source="system") self.initialized_with_env = True
def test_read_environ_config(self): os.environ["DBND__TEST_SECTION__TEST_KEY"] = "TEST_VALUE" actual = read_environ_config() with config(actual): assert config.get("test_section", "test_key") == "TEST_VALUE"