userver: pytest_userver.plugins.dynamic_config Namespace Reference
No Matches
pytest_userver.plugins.dynamic_config Namespace Reference

Detailed Description

Supply dynamic configs for the service in testsuite.


class  _Changelog
class  _ChangelogEntry
class  _ConfigDefaults
class  BaseError
 Base class for exceptions from this module. More...
class  DynamicConfig
 Simple dynamic config backend. More...
class  DynamicConfigNotFoundError
 Config parameter was not found and no default was provided. More...
class  DynamicConfigUninitialized
 Calling dynamic_config.get before defaults are fetched from the service. More...
class  InvalidDefaultsError
 Dynamic config defaults action returned invalid response. More...
class  Missing
class  RemoveKey
class  UnknownConfigError
 Invalid dynamic config name in @pytest.mark.config. More...
class  Updates


DynamicConfig dynamic_config (request, search_path, object_substitute, cache_invalidation_state, _dynamic_config_defaults_storage, config_service_defaults, dynamic_config_changelog, _dynconf_load_json_cached, dynconf_cache_names)
 Fixture that allows to control dynamic config values used by the service.
 pytest_configure (config)
typing.Iterable[str] dynconf_cache_names ()
 _dynconf_json_cache ()
 _dynconf_load_json_cached (json_loads, _dynconf_json_cache)
DynamicConfig taxi_config (dynamic_config)
 Deprecated, use dynamic_config instead.
ConfigDict dynamic_config_fallback_patch ()
 Override this fixture to replace some dynamic config values specifically for testsuite tests:
ConfigDict config_service_defaults (config_fallback_path, dynamic_config_fallback_patch)
 Fixture that returns default values for dynamic config.
_ConfigDefaults _dynamic_config_defaults_storage ()
 userver_config_dynconf_cache (service_tmpdir)
 Returns a function that adjusts the static configuration file for the testsuite.
 userver_config_dynconf_fallback (config_service_defaults)
 Returns a function that adjusts the static configuration file for the testsuite.
 userver_config_dynconf_url (mockserver_info)
 Returns a function that adjusts the static configuration file for the testsuite.
_Changelog dynamic_config_changelog ()
None mock_configs_service (mockserver, DynamicConfig dynamic_config, _Changelog dynamic_config_changelog)
 Adds a mockserver handler that forwards dynamic_config to service's dynamic-config-client component.
 _userver_dynconfig_cache_control (_Changelog dynamic_config_changelog)
typing.Callable[[], None] _check_config_marks (request, _dynamic_config_defaults_storage)


 ConfigDict = typing.Dict[str, typing.Any]

Function Documentation

◆ _check_config_marks()

typing.Callable[[], None] pytest_userver.plugins.dynamic_config._check_config_marks ( request,
_dynamic_config_defaults_storage )

Definition at line 622 of file

◆ _dynamic_config_defaults_storage()

_ConfigDefaults pytest_userver.plugins.dynamic_config._dynamic_config_defaults_storage ( )

Definition at line 462 of file

◆ _dynconf_json_cache()

pytest_userver.plugins.dynamic_config._dynconf_json_cache ( )

Definition at line 368 of file

◆ _dynconf_load_json_cached()

pytest_userver.plugins.dynamic_config._dynconf_load_json_cached ( json_loads,
_dynconf_json_cache )

Definition at line 373 of file

◆ _userver_dynconfig_cache_control()

pytest_userver.plugins.dynamic_config._userver_dynconfig_cache_control ( _Changelog dynamic_config_changelog)

Definition at line 598 of file

◆ dynamic_config_changelog()

_Changelog pytest_userver.plugins.dynamic_config.dynamic_config_changelog ( )

Definition at line 559 of file

◆ dynconf_cache_names()

typing.Iterable[str] pytest_userver.plugins.dynamic_config.dynconf_cache_names ( )

Definition at line 363 of file

◆ pytest_configure()

pytest_userver.plugins.dynamic_config.pytest_configure ( config)

Definition at line 353 of file

◆ taxi_config()

DynamicConfig pytest_userver.plugins.dynamic_config.taxi_config ( dynamic_config)

Deprecated, use dynamic_config instead.

Definition at line 383 of file

Variable Documentation


tuple pytest_userver.plugins.dynamic_config._CHECK_CONFIG_ERROR
Initial value:
1= (
2 'Your are trying to override config value using '
3 '@pytest.mark.config({}) '
4 'that does not seem to be used by your service.\n\n'
5 'In case you really need to disable this check please add the '
6 'following mark to your testcase:\n\n'
7 '@pytest.mark.disable_config_check'

Definition at line 610 of file

◆ ConfigDict

pytest_userver.plugins.dynamic_config.ConfigDict = typing.Dict[str, typing.Any]

Definition at line 51 of file


dict pytest_userver.plugins.dynamic_config.USERVER_CACHE_CONTROL_HOOKS
Initial value:
1= {
2 'dynamic-config-client-updater': '_userver_dynconfig_cache_control',

Definition at line 23 of file


list pytest_userver.plugins.dynamic_config.USERVER_CONFIG_HOOKS
Initial value:
1= [
2 'userver_config_dynconf_cache',
3 'userver_config_dynconf_fallback',
4 'userver_config_dynconf_url',

Definition at line 18 of file