mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-31 14:11:50 +08:00
Add uninstrument test for django (#1557)
This commit is contained in:
@ -414,6 +414,18 @@ class TestMiddleware(WsgiTestBase):
|
|||||||
)
|
)
|
||||||
self.memory_exporter.clear()
|
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
|
# pylint: disable=too-many-locals
|
||||||
def test_wsgi_metrics(self):
|
def test_wsgi_metrics(self):
|
||||||
_expected_metric_names = [
|
_expected_metric_names = [
|
||||||
|
Reference in New Issue
Block a user