Skip to content

Commit

Permalink
Fix instrumentation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Jul 31, 2020
1 parent 9fe6cde commit 0c566f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/util/src/opentelemetry/test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def setUpClass(cls):
cls.original_tracer_provider = trace_api.get_tracer_provider()
result = cls.create_tracer_provider()
cls.tracer_provider, cls.memory_exporter = result
# This is done because set_tracer_provider cannot override the
# current tracer provider.
trace_api._TRACER_PROVIDER = None
trace_api.set_tracer_provider(cls.tracer_provider)
cls.original_meter_provider = metrics_api.get_meter_provider()
result = cls.create_meter_provider()
Expand All @@ -42,6 +45,9 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
# This is done because set_tracer_provider cannot override the
# current tracer provider.
trace_api._TRACER_PROVIDER = None
trace_api.set_tracer_provider(cls.original_tracer_provider)
metrics_api.set_meter_provider(cls.original_meter_provider)

Expand Down

0 comments on commit 0c566f4

Please sign in to comment.