userver: pytest_userver.plugins.base Namespace Reference
Loading...
Searching...
No Matches
pytest_userver.plugins.base Namespace Reference

Detailed Description

Configure the service in testsuite.

Functions

None pytest_addoption (parser)
 
 pytest_configure (config)
 
pathlib.Path service_source_dir (pytestconfig)
 Returns the path to the service source directory that is set by command line --service-source-dir option.
 
pathlib.Path build_dir (pytestconfig)
 Returns the build directory set by command line --build-dir option.
 
pathlib.Path service_binary (pytestconfig)
 Returns the path to service binary set by command line --service-binary option.
 
int service_port (pytestconfig, _original_service_config, choose_free_port)
 Returns the main listener port number of the service set by command line --service-port option.
 
int monitor_port (pytestconfig, _original_service_config, choose_free_port)
 Returns the monitor listener port number of the service set by command line --monitor-port option.
 
int _get_port (original_service_config, choose_free_port, listener_name, port_fixture, option_name)
 
Callable[[Optional[int]], int] choose_free_port (pytestconfig, get_free_port, _testsuite_socket_cleanup, _testsuite_default_af)
 A function that chooses a free port based on the optional hint given in the parameter.
 
int _get_free_port_not_allocated (get_free_port)
 
bool _is_port_free (int port_num, int family, str address)
 
 userver_base_prepare_service_config ()
 

Variables

list USERVER_CONFIG_HOOKS = ['userver_base_prepare_service_config']
 
 _allocated_ports = set()
 

Function Documentation

◆ _get_free_port_not_allocated()

int pytest_userver.plugins.base._get_free_port_not_allocated ( get_free_port)
protected

Definition at line 197 of file base.py.

◆ _get_port()

int pytest_userver.plugins.base._get_port ( original_service_config,
choose_free_port,
listener_name,
port_fixture,
option_name )
protected

Definition at line 140 of file base.py.

◆ _is_port_free()

bool pytest_userver.plugins.base._is_port_free ( int port_num,
int family,
str address )
protected

Definition at line 205 of file base.py.

◆ pytest_addoption()

None pytest_userver.plugins.base.pytest_addoption ( parser)

Definition at line 17 of file base.py.

◆ pytest_configure()

pytest_userver.plugins.base.pytest_configure ( config)

Definition at line 51 of file base.py.

◆ userver_base_prepare_service_config()

pytest_userver.plugins.base.userver_base_prepare_service_config ( )

Definition at line 216 of file base.py.

Variable Documentation

◆ _allocated_ports

pytest_userver.plugins.base._allocated_ports = set()
protected

Definition at line 169 of file base.py.

◆ USERVER_CONFIG_HOOKS

list pytest_userver.plugins.base.USERVER_CONFIG_HOOKS = ['userver_base_prepare_service_config']

Definition at line 14 of file base.py.