granular_configuration_language .mock
- granular_configuration_language.mock.patch_config(
- in_config: TypedConfiguration | LazyLoadConfiguration,
- values: Mapping[Any, Any],
- clear: bool = False,
Works like
patch.dictexcept forConfigurationinstance.This works around the immutability of
Configurationwhen trying to usepatch.dictdirectly.Caution
This is only meant to be used to mutate your configuration during your tests!
- Parameters:
in_config (TypedConfiguration | LazyLoadConfiguration) –
Configurationbeing patched.values (Mapping[Any, Any]) – dictionary of values to set in the configuration.
clear (bool) – If
Truethen the configuration will be cleared before the new values are set.
- Returns:
A context manager
- Return type: