Fixtures to use with testsuite.
Namespaces | |
namespace | pytest_userver.plugins.core |
Python plugin that provides core fixtures for functional tests with testsuite; see Functional service tests (testsuite) for an introduction. | |
namespace | pytest_userver.plugins.grpc |
Python plugin that provides gRPC fixtures for functional tests with testsuite; see Functional service tests (testsuite) for an introduction. | |
namespace | pytest_userver.plugins.ydb |
pytest plugin that provides YDB fixtures for functional tests with testsuite; see YDB for an introduction. | |
Functions | |
pathlib.Path | pytest_userver.plugins.base.service_source_dir (pytestconfig) |
Returns the path to the service source directory that is set by command line --service-source-dir option. | |
pathlib.Path | pytest_userver.plugins.base.build_dir (pytestconfig) |
Returns the build directory set by command line --build-dir option. | |
pathlib.Path | pytest_userver.plugins.base.service_binary (pytestconfig) |
Returns the path to service binary set by command line --service-binary option. | |
int | pytest_userver.plugins.base.service_port (pytestconfig, _original_service_config) |
Returns the main listener port number of the service set by command line --service-port option. | |
int | pytest_userver.plugins.base.monitor_port (pytestconfig, _original_service_config) |
Returns the monitor listener port number of the service set by command line --monitor-port option. | |
InvalidationState | pytest_userver.plugins.caches.cache_invalidation_state () |
A fixture for notifying the service of changes in cache data sources. | |
typing.Callable[[DaemonInstance], CacheControl] | pytest_userver.plugins.caches.userver_cache_control (_userver_cache_control_context, _userver_cache_fixtures, request) |
Userver cache control handler. | |
pathlib.Path | pytest_userver.plugins.config.service_config_path (pytestconfig, service_binary) |
Returns the path to service.yaml file set by command line --service-config option. | |
pathlib.Path | pytest_userver.plugins.config.db_dump_schema_path (service_binary, service_tmpdir) |
Runs the service binary with --dump-db-schema argument, dumps the 0_db_schema.sql file with database schema and returns path to it. | |
typing.Optional[pathlib.Path] | pytest_userver.plugins.config.service_config_vars_path (pytestconfig) |
Returns the path to config_vars.yaml file set by command line --service-config-vars option. | |
typing.Optional[pathlib.Path] | pytest_userver.plugins.config.service_secdist_path (pytestconfig) |
Returns the path to secure_data.json file set by command line --service-secdist option. | |
pathlib.Path | pytest_userver.plugins.config.config_fallback_path (pytestconfig) |
Returns the path to dynamic config fallback file set by command line --config-fallback option. | |
pytest_userver.plugins.config.service_tmpdir (service_binary, tmp_path_factory) | |
Returns the path for temporary files. | |
pathlib.Path | pytest_userver.plugins.config.service_config_path_temp (service_tmpdir, service_config, service_config_yaml) |
Dumps the contents of the service_config_yaml into a static config for testsuite and returns the path to the config file. | |
dict | pytest_userver.plugins.config.service_config_yaml (_service_config_hooked) |
Returns the static config values after the USERVER_CONFIG_HOOKS were applied (if any). | |
dict | pytest_userver.plugins.config.service_config_vars (_service_config_hooked) |
Returns the static config variables (config_vars.yaml) values after the USERVER_CONFIG_HOOKS were applied (if any). | |
dict | pytest_userver.plugins.config.service_config (service_config_yaml, service_config_vars, service_env) |
Returns the static config values after the USERVER_CONFIG_HOOKS were applied (if any) and with all the '$', environment and fallback variables substituted. | |
pytest_userver.plugins.config.userver_config_http_server (service_port, monitor_port) | |
Returns a function that adjusts the static configuration file for testsuite. | |
typing.List[str] | pytest_userver.plugins.config.allowed_url_prefixes_extra () |
By default, userver HTTP client is only allowed to talk to mockserver when running in testsuite. | |
pytest_userver.plugins.config.userver_config_http_client (mockserver_info, mockserver_ssl_info, allowed_url_prefixes_extra) | |
Returns a function that adjusts the static configuration file for testsuite. | |
str | pytest_userver.plugins.config.userver_default_log_level () |
Default log level to use in userver if no caoomand line option was provided. | |
str | pytest_userver.plugins.config.userver_log_level (pytestconfig, userver_default_log_level) |
Returns –service-log-level value if provided, otherwise returns userver_default_log_level() value from fixture. | |
pytest_userver.plugins.config.userver_config_logging (userver_log_level, _service_logfile_path) | |
Returns a function that adjusts the static configuration file for testsuite. | |
pytest_userver.plugins.config.userver_config_logging_otlp () | |
Returns a function that adjusts the static configuration file for testsuite. | |
pytest_userver.plugins.config.userver_config_testsuite (pytestconfig, mockserver_info) | |
Returns a function that adjusts the static configuration file for testsuite. | |
pytest_userver.plugins.config.userver_config_secdist (service_secdist_path) | |
Returns a function that adjusts the static configuration file for testsuite. | |
pathlib.Path | pytest_userver.plugins.dumps.userver_dumps_root (tmp_path_factory) |
The directory which the service will use for cache dumps. | |
pytest_userver.plugins.dumps.read_latest_dump (userver_dumps_root) | |
Read the latest dump produced by a specified dumper. | |
pytest_userver.plugins.dumps.cleanup_userver_dumps (userver_dumps_root, request) | |
To avoid leaking dumps between tests, cache_dump_dir must be cleaned after each test. | |
DynamicConfig | pytest_userver.plugins.dynamic_config.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. | |
ConfigDict | pytest_userver.plugins.dynamic_config.dynamic_config_fallback_patch () |
Override this fixture to replace some dynamic config values specifically for testsuite tests: | |
ConfigDict | pytest_userver.plugins.dynamic_config.config_service_defaults (config_fallback_path, dynamic_config_fallback_patch) |
Fixture that returns default values for dynamic config. | |
pytest_userver.plugins.dynamic_config.userver_config_dynconf_cache (service_tmpdir) | |
Returns a function that adjusts the static configuration file for the testsuite. | |
pytest_userver.plugins.dynamic_config.userver_config_dynconf_fallback (config_service_defaults) | |
Returns a function that adjusts the static configuration file for the testsuite. | |
pytest_userver.plugins.dynamic_config.userver_config_dynconf_url (mockserver_info) | |
Returns a function that adjusts the static configuration file for the testsuite. | |
None | pytest_userver.plugins.dynamic_config.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. | |
int | pytest_userver.plugins.grpc.client.grpc_service_port (service_config) |
Returns the gRPC listener port number of the service that is set in the static configuration file. | |
str | pytest_userver.plugins.grpc.client.grpc_service_endpoint (service_config, grpc_service_port) |
Returns the gRPC endpoint of the service. | |
float | pytest_userver.plugins.grpc.client.grpc_service_timeout (pytestconfig) |
Returns the gRPC timeout for the service that is set by the command line option --service-timeout . | |
Callable[[grpc.aio.ClientCallDetails], Awaitable[None]] | pytest_userver.plugins.grpc.client.grpc_client_prepare (service_client, client.TestsuiteClientConfig _testsuite_client_config) |
Returns the function that will be called in before each gRPC request, client-side. | |
pytest_userver.plugins.grpc.client.grpc_channel (grpc_service_endpoint, grpc_service_deps, grpc_service_timeout, grpc_session_channel, _grpc_channel_interceptor, grpc_client_prepare) | |
Returns the gRPC channel configured by the parameters from the grpc_service_endpoint fixture. | |
pytest_userver.plugins.grpc.client.grpc_service_deps (service_client) | |
gRPC service dependencies hook. | |
pytest_userver.plugins.grpc.client.userver_config_grpc_mockserver (grpc_mockserver_endpoint) | |
Returns a function that adjusts the static config for testsuite. | |
str | pytest_userver.plugins.grpc.mockserver.grpc_mockserver_endpoint (pytestconfig, get_free_port) |
Returns the gRPC endpoint to start the mocking server that is set by command line --grpc-mockserver-host and --grpc-mockserver-port options. | |
grpc.aio.Server | pytest_userver.plugins.grpc.mockserver.grpc_mockserver (grpc_mockserver_endpoint) |
Returns the gRPC mocking server. | |
pytest_userver.plugins.grpc.mockserver.create_grpc_mock () | |
Creates the gRPC mock server for the provided type. | |
str | pytest_userver.plugins.kafka.kafka_secdist (_bootstrap_servers, service_config) |
Automatically generates secdist config from user static config. | |
pytest_userver.plugins.mongo.userver_mongo_config (mongo_connection_info) | |
Returns a function that adjusts the static configuration file for the testsuite. | |
pytest_userver.plugins.postgresql.userver_pg_config (pgsql_local) | |
Returns a function that adjusts the static configuration file for the testsuite. | |
typing.Generator[sql.RegisteredTrx, None, None] | pytest_userver.plugins.postgresql.userver_pg_trx (testpoint) |
The fixture maintains transaction fault injection state using RegisteredTrx class. | |
typing.Generator[RegisteredNtrx, None, None] | pytest_userver.plugins.postgresql.userver_pg_ntrx (testpoint) |
The fixture maintains single query fault injection state using RegisteredNtrx class. | |
pytest_userver.plugins.service.service_env () | |
Override this to pass extra environment variables to the service. | |
typing.Optional[str] | pytest_userver.plugins.service.service_http_ping_url (service_config, service_baseurl) |
Returns the service HTTP ping URL that is used by the testsuite to detect that the service is ready to work. | |
net.HealthChecks | pytest_userver.plugins.service.service_non_http_health_checks (service_config) |
Returns a health checks info. | |
pytest_userver.plugins.service.service_daemon (pytestconfig, create_daemon_scope, service_env, service_http_ping_url, service_config_path_temp, service_config, service_binary, service_non_http_health_checks) | |
Configures the health checking to use service_http_ping_url fixture value if it is not None; otherwise uses the service_non_http_health_checks info. | |
None | pytest_userver.plugins.service_client.extra_client_deps () |
Service client dependencies hook. | |
None | pytest_userver.plugins.service_client.auto_client_deps (request) |
Service client dependencies hook that knows about pgsql, mongodb, clickhouse, rabbitmq, kafka, redis_store, ydb, and mysql dependencies. | |
client.Client | pytest_userver.plugins.service_client.service_client (ensure_daemon_started, service_daemon, dynamic_config, mock_configs_service, cleanup_userver_dumps, userver_client_cleanup, client.TestsuiteClientConfig _testsuite_client_config, _service_client_base, _service_client_testsuite, extra_client_deps, auto_client_deps) |
Main fixture that provides access to userver based service. | |
typing.Callable[[client.Client], typing.AsyncGenerator] | pytest_userver.plugins.service_client.userver_client_cleanup (request, _userver_logging_plugin, _dynamic_config_defaults_storage, _check_config_marks, dynamic_config) |
Contains the pre-test and post-test setup that depends on service_client. | |
pytest_userver.plugins.service_client.websocket_client (service_client, service_port) | |
Fixture that provides access to userver based websocket service. | |
client.ClientMonitor | pytest_userver.plugins.service_client.monitor_client (service_client, service_client_options, mockserver, str monitor_baseurl, client.TestsuiteClientConfig _testsuite_client_config) |
Main fixture that provides access to userver monitor listener. | |
str | pytest_userver.plugins.service_client.service_baseurl (service_port) |
Returns the main listener URL of the service. | |
str | pytest_userver.plugins.service_client.monitor_baseurl (monitor_port) |
Returns the main monitor URL of the service. | |
pytest_userver.plugins.testpoint.userver_config_testpoint (mockserver_info) | |
Returns a function that adjusts the static configuration file for the testsuite. | |
pathlib.Path | pytest_userver.plugins.ydb.ydbsupport.ydb_migration_dir (service_source_dir) |
Directory with migration files. | |
pathlib.Path | pytest_userver.plugins.ydb.ydbsupport.goose_binary_path () |
Path to 'goose' migration tool. | |
pathlib.Path | pytest_userver.plugins.ydb.ydbsupport.ydb_cli () |
Path to YDB CLI executable. | |
sql.RegisteredTrx | pytest_userver.plugins.ydb.ydbsupport.userver_ydb_trx (testpoint) |
The fixture maintains transaction fault injection state using RegisteredTrx class. | |
pytest_userver.plugins.ydb.ydbsupport.userver_config_ydb (ydb_service_settings) | |
Returns a function that adjusts the static configuration file for testsuite. | |
typing.List[str] pytest_userver.plugins.config.allowed_url_prefixes_extra | ( | ) |
By default, userver HTTP client is only allowed to talk to mockserver when running in testsuite.
This makes tests repeatable and encapsulated.
Override this fixture to whitelist some additional URLs. It is still strongly advised to only talk to localhost in tests.
None pytest_userver.plugins.service_client.auto_client_deps | ( | request | ) |
Service client dependencies hook that knows about pgsql, mongodb, clickhouse, rabbitmq, kafka, redis_store, ydb, and mysql dependencies.
To add some other dependencies prefer overriding the extra_client_deps() fixture.
Definition at line 37 of file service_client.py.
pathlib.Path pytest_userver.plugins.base.build_dir | ( | pytestconfig | ) |
InvalidationState pytest_userver.plugins.caches.cache_invalidation_state | ( | ) |
pytest_userver.plugins.dumps.cleanup_userver_dumps | ( | userver_dumps_root, | |
request ) |
To avoid leaking dumps between tests, cache_dump_dir must be cleaned after each test.
To observe the dumps, add a final time.sleep(1000000)
to your test locally. The returned function may also be used to clean dumps manually as appropriate.
pathlib.Path pytest_userver.plugins.config.config_fallback_path | ( | pytestconfig | ) |
ConfigDict pytest_userver.plugins.dynamic_config.config_service_defaults | ( | config_fallback_path, | |
dynamic_config_fallback_patch ) |
Fixture that returns default values for dynamic config.
You may override it in your local conftest.py or fixture:
Definition at line 405 of file dynamic_config.py.
pytest_userver.plugins.grpc.mockserver.create_grpc_mock | ( | ) |
Creates the gRPC mock server for the provided type.
Definition at line 109 of file mockserver.py.
pathlib.Path pytest_userver.plugins.config.db_dump_schema_path | ( | service_binary, | |
service_tmpdir ) |
DynamicConfig pytest_userver.plugins.dynamic_config.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.
After change to the config, be sure to call:
HTTP client requests call it automatically before each request.
Definition at line 307 of file dynamic_config.py.
ConfigDict pytest_userver.plugins.dynamic_config.dynamic_config_fallback_patch | ( | ) |
Override this fixture to replace some dynamic config values specifically for testsuite tests:
Definition at line 388 of file dynamic_config.py.
None pytest_userver.plugins.service_client.extra_client_deps | ( | ) |
Service client dependencies hook.
Feel free to override, e.g.:
Definition at line 23 of file service_client.py.
pathlib.Path pytest_userver.plugins.ydb.ydbsupport.goose_binary_path | ( | ) |
Path to 'goose' migration tool.
Override this fixture to change the way 'goose' binary is discovered.
Definition at line 170 of file ydbsupport.py.
pytest_userver.plugins.grpc.client.grpc_channel | ( | grpc_service_endpoint, | |
grpc_service_deps, | |||
grpc_service_timeout, | |||
grpc_session_channel, | |||
_grpc_channel_interceptor, | |||
grpc_client_prepare ) |
Callable[[grpc.aio.ClientCallDetails], Awaitable[None]] pytest_userver.plugins.grpc.client.grpc_client_prepare | ( | service_client, | |
client.TestsuiteClientConfig | _testsuite_client_config ) |
grpc.aio.Server pytest_userver.plugins.grpc.mockserver.grpc_mockserver | ( | grpc_mockserver_endpoint | ) |
Returns the gRPC mocking server.
Definition at line 78 of file mockserver.py.
str pytest_userver.plugins.grpc.mockserver.grpc_mockserver_endpoint | ( | pytestconfig, | |
get_free_port ) |
Returns the gRPC endpoint to start the mocking server that is set by command line --grpc-mockserver-host
and --grpc-mockserver-port
options.
For port 0, picks some free port.
Override this fixture to customize the endpoint used by gRPC mockserver.
Definition at line 57 of file mockserver.py.
pytest_userver.plugins.grpc.client.grpc_service_deps | ( | service_client | ) |
str pytest_userver.plugins.grpc.client.grpc_service_endpoint | ( | service_config, | |
grpc_service_port ) |
int pytest_userver.plugins.grpc.client.grpc_service_port | ( | service_config | ) |
float pytest_userver.plugins.grpc.client.grpc_service_timeout | ( | pytestconfig | ) |
str pytest_userver.plugins.kafka.kafka_secdist | ( | _bootstrap_servers, | |
service_config ) |
Automatically generates secdist config from user static config.
_bootstrap_servers
is testsuite's fixture that determines current bootstrap servers list depends on Kafka testsuite plugin's settings.
None pytest_userver.plugins.dynamic_config.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.
Definition at line 561 of file dynamic_config.py.
str pytest_userver.plugins.service_client.monitor_baseurl | ( | monitor_port | ) |
Returns the main monitor URL of the service.
Override this fixture to change the main monitor URL that the testsuite uses for tests.
Definition at line 278 of file service_client.py.
client.ClientMonitor pytest_userver.plugins.service_client.monitor_client | ( | service_client, | |
service_client_options, | |||
mockserver, | |||
str | monitor_baseurl, | ||
client.TestsuiteClientConfig | _testsuite_client_config ) |
Main fixture that provides access to userver monitor listener.
Definition at line 192 of file service_client.py.
int pytest_userver.plugins.base.monitor_port | ( | pytestconfig, | |
_original_service_config ) |
Returns the monitor listener port number of the service set by command line --monitor-port
option.
If no port is specified in the command line option, keeps the original port specified in the static config.
Override this fixture to change the way the monitor listener port number is detected by testsuite.
pytest_userver.plugins.dumps.read_latest_dump | ( | userver_dumps_root | ) |
str pytest_userver.plugins.service_client.service_baseurl | ( | service_port | ) |
Returns the main listener URL of the service.
Override this fixture to change the main listener URL that the testsuite uses for tests.
Definition at line 265 of file service_client.py.
pathlib.Path pytest_userver.plugins.base.service_binary | ( | pytestconfig | ) |
client.Client pytest_userver.plugins.service_client.service_client | ( | ensure_daemon_started, | |
service_daemon, | |||
dynamic_config, | |||
mock_configs_service, | |||
cleanup_userver_dumps, | |||
userver_client_cleanup, | |||
client.TestsuiteClientConfig | _testsuite_client_config, | ||
_service_client_base, | |||
_service_client_testsuite, | |||
extra_client_deps, | |||
auto_client_deps ) |
Main fixture that provides access to userver based service.
Definition at line 81 of file service_client.py.
dict pytest_userver.plugins.config.service_config | ( | service_config_yaml, | |
service_config_vars, | |||
service_env ) |
pathlib.Path pytest_userver.plugins.config.service_config_path | ( | pytestconfig, | |
service_binary ) |
pathlib.Path pytest_userver.plugins.config.service_config_path_temp | ( | service_tmpdir, | |
service_config, | |||
service_config_yaml ) |
dict pytest_userver.plugins.config.service_config_vars | ( | _service_config_hooked | ) |
Returns the static config variables (config_vars.yaml) values after the USERVER_CONFIG_HOOKS were applied (if any).
Prefer using pytest_userver.plugins.config.service_config
typing.Optional[pathlib.Path] pytest_userver.plugins.config.service_config_vars_path | ( | pytestconfig | ) |
dict pytest_userver.plugins.config.service_config_yaml | ( | _service_config_hooked | ) |
Returns the static config values after the USERVER_CONFIG_HOOKS were applied (if any).
Prefer using pytest_userver.plugins.config.service_config
pytest_userver.plugins.service.service_daemon | ( | pytestconfig, | |
create_daemon_scope, | |||
service_env, | |||
service_http_ping_url, | |||
service_config_path_temp, | |||
service_config, | |||
service_binary, | |||
service_non_http_health_checks ) |
Configures the health checking to use service_http_ping_url fixture value if it is not None; otherwise uses the service_non_http_health_checks info.
Starts the service daemon.
Definition at line 103 of file service.py.
pytest_userver.plugins.service.service_env | ( | ) |
Override this to pass extra environment variables to the service.
Definition at line 53 of file service.py.
typing.Optional[str] pytest_userver.plugins.service.service_http_ping_url | ( | service_config, | |
service_baseurl ) |
Returns the service HTTP ping URL that is used by the testsuite to detect that the service is ready to work.
Returns None if there's no such URL.
By default attempts to find server::handlers::Ping component by "handler-ping" name in static config. Override this fixture to change the behavior.
Definition at line 64 of file service.py.
net.HealthChecks pytest_userver.plugins.service.service_non_http_health_checks | ( | service_config | ) |
Returns a health checks info.
By default, returns pytest_userver.utils.net.get_health_checks_info().
Override this fixture to change the way testsuite detects the tested service being alive.
Definition at line 85 of file service.py.
int pytest_userver.plugins.base.service_port | ( | pytestconfig, | |
_original_service_config ) |
Returns the main listener port number of the service set by command line --service-port
option.
If no port is specified in the command line option, keeps the original port specified in the static config.
Override this fixture to change the way the main listener port number is detected by the testsuite.
typing.Optional[pathlib.Path] pytest_userver.plugins.config.service_secdist_path | ( | pytestconfig | ) |
pathlib.Path pytest_userver.plugins.base.service_source_dir | ( | pytestconfig | ) |
pytest_userver.plugins.config.service_tmpdir | ( | service_binary, | |
tmp_path_factory ) |
typing.Callable[[DaemonInstance], CacheControl] pytest_userver.plugins.caches.userver_cache_control | ( | _userver_cache_control_context, | |
_userver_cache_fixtures, | |||
request ) |
Userver cache control handler.
To install per cache handler use USERVER_CACHE_CONTROL_HOOKS variable in your pytest plugin:
typing.Callable[[client.Client], typing.AsyncGenerator] pytest_userver.plugins.service_client.userver_client_cleanup | ( | request, | |
_userver_logging_plugin, | |||
_dynamic_config_defaults_storage, | |||
_check_config_marks, | |||
dynamic_config ) |
Contains the pre-test and post-test setup that depends on service_client.
Feel free to override, but in that case make sure to call the original userver_client_cleanup
fixture instance.
Definition at line 116 of file service_client.py.
pytest_userver.plugins.dynamic_config.userver_config_dynconf_cache | ( | service_tmpdir | ) |
Returns a function that adjusts the static configuration file for the testsuite.
Sets dynamic-config.fs-cache-path
to a file that is reset after the tests to avoid leaking dynamic config values between test sessions.
Definition at line 464 of file dynamic_config.py.
pytest_userver.plugins.dynamic_config.userver_config_dynconf_fallback | ( | config_service_defaults | ) |
Returns a function that adjusts the static configuration file for the testsuite.
Removes dynamic-config.defaults-path
. Updates dynamic-config.defaults
with config_service_defaults
.
Definition at line 492 of file dynamic_config.py.
pytest_userver.plugins.dynamic_config.userver_config_dynconf_url | ( | mockserver_info | ) |
Returns a function that adjusts the static configuration file for the testsuite.
Sets the dynamic-config-client.config-url
to the value of mockserver configs-service, so that the mock_configs_service fixture could work.
Definition at line 531 of file dynamic_config.py.
pytest_userver.plugins.grpc.client.userver_config_grpc_mockserver | ( | grpc_mockserver_endpoint | ) |
pytest_userver.plugins.config.userver_config_http_client | ( | mockserver_info, | |
mockserver_ssl_info, | |||
allowed_url_prefixes_extra ) |
pytest_userver.plugins.config.userver_config_http_server | ( | service_port, | |
monitor_port ) |
Returns a function that adjusts the static configuration file for testsuite.
Sets the server.listener.port
to listen on service_port fixture value; sets the server.listener-monitor.port
to listen on monitor_port fixture value.
pytest_userver.plugins.config.userver_config_logging | ( | userver_log_level, | |
_service_logfile_path ) |
pytest_userver.plugins.config.userver_config_logging_otlp | ( | ) |
pytest_userver.plugins.config.userver_config_secdist | ( | service_secdist_path | ) |
Returns a function that adjusts the static configuration file for testsuite.
Sets the default-secdist-provider.config
to the value of service_secdist_path fixture.
pytest_userver.plugins.testpoint.userver_config_testpoint | ( | mockserver_info | ) |
Returns a function that adjusts the static configuration file for the testsuite.
Sets the tests-control.skip-unregistered-testpoints
to True
.
Definition at line 53 of file testpoint.py.
pytest_userver.plugins.config.userver_config_testsuite | ( | pytestconfig, | |
mockserver_info ) |
Returns a function that adjusts the static configuration file for testsuite.
Sets up testsuite-support
component, which:
Sets the testsuite-enabled
in config_vars.yaml to True
; sets the tests-control.testpoint-url
to mockserver URL.
pytest_userver.plugins.ydb.ydbsupport.userver_config_ydb | ( | ydb_service_settings | ) |
Returns a function that adjusts the static configuration file for testsuite.
For all ydb.databases
, sets endpoint
and database
to the local test YDB instance.
Definition at line 335 of file ydbsupport.py.
str pytest_userver.plugins.config.userver_default_log_level | ( | ) |
pathlib.Path pytest_userver.plugins.dumps.userver_dumps_root | ( | tmp_path_factory | ) |
str pytest_userver.plugins.config.userver_log_level | ( | pytestconfig, | |
userver_default_log_level ) |
pytest_userver.plugins.mongo.userver_mongo_config | ( | mongo_connection_info | ) |
pytest_userver.plugins.postgresql.userver_pg_config | ( | pgsql_local | ) |
Returns a function that adjusts the static configuration file for the testsuite.
Sets the dbconnection
to the testsuite started PostgreSQL credentials if there's only one dbconnection
in static config.
Definition at line 71 of file postgresql.py.
typing.Generator[RegisteredNtrx, None, None] pytest_userver.plugins.postgresql.userver_pg_ntrx | ( | testpoint | ) |
The fixture maintains single query fault injection state using RegisteredNtrx class.
Definition at line 151 of file postgresql.py.
typing.Generator[sql.RegisteredTrx, None, None] pytest_userver.plugins.postgresql.userver_pg_trx | ( | testpoint | ) |
The fixture maintains transaction fault injection state using RegisteredTrx class.
Definition at line 126 of file postgresql.py.
sql.RegisteredTrx pytest_userver.plugins.ydb.ydbsupport.userver_ydb_trx | ( | testpoint | ) |
The fixture maintains transaction fault injection state using RegisteredTrx class.
Definition at line 312 of file ydbsupport.py.
pytest_userver.plugins.service_client.websocket_client | ( | service_client, | |
service_port ) |
Fixture that provides access to userver based websocket service.
Definition at line 166 of file service_client.py.
pathlib.Path pytest_userver.plugins.ydb.ydbsupport.ydb_cli | ( | ) |
Path to YDB CLI executable.
Override this fixture to change the way YDB CLI is discovered.
Definition at line 222 of file ydbsupport.py.
pathlib.Path pytest_userver.plugins.ydb.ydbsupport.ydb_migration_dir | ( | service_source_dir | ) |
Directory with migration files.
Definition at line 129 of file ydbsupport.py.