Add uninstrument test for django (#1557)

This commit is contained in:
Shalev Roda
2023-01-06 19:34:15 +02:00
committed by GitHub
parent a97326d871
commit 1f0dda9865

View File

@ -414,6 +414,18 @@ class TestMiddleware(WsgiTestBase):
)
self.memory_exporter.clear()
def test_uninstrument(self):
Client().get("/route/2020/template/")
spans = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans), 1)
self.memory_exporter.clear()
_django_instrumentor.uninstrument()
Client().get("/route/2020/template/")
spans = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans), 0)
# pylint: disable=too-many-locals
def test_wsgi_metrics(self):
_expected_metric_names = [