mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-29 21:23:55 +08:00
add a test for pymemcache using NoOpTracerProvider (#1650)
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
@ -509,6 +509,19 @@ class PymemcacheClientTestCase(
|
||||
|
||||
PymemcacheInstrumentor().instrument()
|
||||
|
||||
def test_no_op_tracer_provider(self):
|
||||
PymemcacheInstrumentor().uninstrument()
|
||||
tracer_provider = trace_api.NoOpTracerProvider()
|
||||
PymemcacheInstrumentor().instrument(tracer_provider=tracer_provider)
|
||||
|
||||
client = self.make_client([b"STORED\r\n"])
|
||||
result = client.set(b"key", b"value", noreply=False)
|
||||
self.assertTrue(result)
|
||||
|
||||
spans = self.memory_exporter.get_finished_spans()
|
||||
assert spans is not None
|
||||
self.assertEqual(len(spans), 0)
|
||||
|
||||
|
||||
class PymemcacheHashClientTestCase(TestBase):
|
||||
"""Tests for a patched pymemcache.client.hash.HashClient."""
|
||||
|
Reference in New Issue
Block a user