1
    2import pytest
    3 
    5 
    6 
    7pytest_plugins = ['pytest_userver.plugins.core']
    8 
    9 
   10@pytest.fixture(scope='session')
   11def tcp_service_port(service_config_yaml) -> int:
   12    components = service_config_yaml['components_manager']['components']
   13    tcp_hello = components.get('tcp-hello')
   14    assert tcp_hello, 'No "tcp-hello" component found'
   15    return int(tcp_hello['port'])
   16 
   17 
   18@pytest.fixture(scope='session')
   19def service_non_http_health_checks(
   20        service_config_yaml, tcp_service_port,
   21) -> net.HealthChecks:
   22    checks = net.get_health_checks_info(service_config_yaml)
   23    checks.tcp.append(net.HostPort(host='localhost', port=tcp_service_port))
   24    return checks
   25