def test_uninstrument_application_and_client(self):
        response = self.http_fetch(self.get_url('/endpoint'))
        assert response.code == 200

        spans = self.tracer.finished_spans()
        assert len(spans) == 2
        assert all([span.finished for span in spans])
        self.tracer.reset()
        uninstrument()

        response = self.http_fetch(self.get_url('/endpoint'))
        assert response.code == 200
        assert self.tracer.finished_spans() == []
    def test_uninstrument_client(self):
        response = self.http_fetch(self.get_url('/endpoint'))
        assert response.code == 200

        spans = self.tracer.finished_spans()
        assert len(spans) == 1
        assert spans[0].finished
        self.tracer.reset()
        uninstrument()

        response = self.http_fetch(self.get_url('/endpoint'))
        assert response.code == 200
        assert self.tracer.finished_spans() == []
    def test_uninstrument_application(self):
        self.http_client.fetch(self.get_url('/endpoint'), self.stop)
        response = self.wait()
        assert response.code == 200

        spans = self.tracer.finished_spans()
        assert len(spans) == 1
        assert spans[0].finished
        self.tracer.reset()
        uninstrument()

        self.http_client.fetch(self.get_url('/endpoint'), self.stop)
        response = self.wait()
        assert response.code == 200
        assert self.tracer.finished_spans() == []
 def uninstrument_tornado(self):
     yield
     uninstrument()