async def test_user_specified_service(tracer, aiohttp_client, loop): """ When a service name is specified by the user The aiohttp integration should use it as the service name """ unpatch() with override_global_config(dict(service="mysvc")): patch() app = setup_app() trace_app(app, tracer) Pin.override(aiohttp_jinja2, tracer=tracer) client = await aiohttp_client(app) request = await client.request("GET", "/template/") await request.text() traces = tracer.pop_traces() assert 1 == len(traces) assert 2 == len(traces[0]) request_span = traces[0][0] assert request_span.service == "mysvc" template_span = traces[0][1] assert template_span.service == "mysvc"
def disable_tracing(self): unpatch()