2Helpers to make the `make start-*` commands work.
5from collections.abc
import Iterable
6from collections.abc
import Sequence
10pytest_plugins = [
'pytest_userver.plugins.generated_tests']
13def pytest_generate_virtual_tests(
15 config: pytest.Config,
16 existing_items: Sequence[pytest.Item],
17) -> Iterable[pytest.Item]:
18 if not config.option.service_runner_mode:
21 for item
in existing_items:
22 for marker
in item.own_markers:
23 if marker.name ==
'servicetest':
26 yield pytest.Function.from_parent(
28 name=test_service_default.__name__,
29 callobj=test_service_default,
33@pytest.mark.servicetest
41 This is default service runner testcase. Feel free to override it
42 in your own tests, e.g.:
45 @pytest.mark.servicetest
46 def test_service(service_client):
50 @ingroup userver_testsuite
54 message = f
'\n{delimiter}\nStarted service at {service_baseurl}'
56 message += f
'\nMonitor URL is {monitor_baseurl}'
57 if 'grpc_service_endpoint' in request.fixturenames:
58 grpc_endpoint = request.getfixturevalue(
'grpc_service_endpoint')
59 message += f
'\ngRPC endpoint is {grpc_endpoint}'
60 message += f
'\n{delimiter}\n'