Removing reload in testbase
# limitations under the License.
import unittest
-from importlib import reload
from opentelemetry import trace as trace_api
from opentelemetry.sdk.trace import TracerProvider, export
@@ -26,6 +25,7 @@ class TestBase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.tracer_provider = TracerProvider()
+ cls.original_provider = trace_api.get_tracer_provider()
trace_api.set_tracer_provider(cls.tracer_provider)
cls.memory_exporter = InMemorySpanExporter()
span_processor = export.SimpleExportSpanProcessor(cls.memory_exporter)
@@ -33,7 +33,7 @@ class TestBase(unittest.TestCase):
@classmethod
def tearDownClass(cls):
- reload(trace_api)
+ trace_api.set_tracer_provider(cls.original_provider)
def setUp(self):
self.memory_exporter.clear()
