Skip to content

Commit 57f59b0

Browse files
dmanchondecko
authored andcommitted
aiohttp server tests
1 parent 5a14c7d commit 57f59b0

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

instrumentation/opentelemetry-instrumentation-aiohttp-server/tests/test_aiohttp_server_integration.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,15 @@
1818
import unittest
1919
import urllib.parse
2020
from functools import partial
21-
from http import HTTPStatus
2221
from unittest import mock
2322

2423
import aiohttp
2524
import aiohttp.test_utils
26-
import yarl
2725
from pkg_resources import iter_entry_points
2826

29-
from opentelemetry import context
30-
from opentelemetry.instrumentation import aiohttp_server
31-
from opentelemetry.instrumentation.aiohttp_server import (
32-
AioHttpServerInstrumentor,
33-
)
34-
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
27+
from opentelemetry.instrumentation.aiohttp_server import AioHttpServerInstrumentor
3528
from opentelemetry.semconv.trace import SpanAttributes
3629
from opentelemetry.test.test_base import TestBase
37-
from opentelemetry.trace import Span, StatusCode
3830

3931

4032
def run_with_test_server(
@@ -131,3 +123,13 @@ def test_not_recording(self):
131123
self.assertTrue(mock_span.is_recording.called)
132124
self.assertFalse(mock_span.set_attribute.called)
133125
self.assertFalse(mock_span.set_status.called)
126+
127+
128+
class TestLoadingAioHttpInstrumentor(unittest.TestCase):
129+
def test_loading_instrumentor(self):
130+
entry_points = iter_entry_points(
131+
"opentelemetry_instrumentor", "aiohttp-server"
132+
)
133+
134+
instrumentor = next(entry_points).load()()
135+
self.assertIsInstance(instrumentor, AioHttpServerInstrumentor)

0 commit comments

Comments
 (0)