Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing reload in testbase #604

Merged
merged 3 commits into from
Apr 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/util/src/opentelemetry/test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import unittest
from importlib import reload

from opentelemetry import trace as trace_api
from opentelemetry.sdk.trace import TracerProvider, export
Expand All @@ -26,14 +25,15 @@ 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)
cls.tracer_provider.add_span_processor(span_processor)

@classmethod
def tearDownClass(cls):
reload(trace_api)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that because I wanted to invalidate the call to set_tracer_provider(cls.tracer_provider), could it be a good idea to invalidate that by doing something like set_tracer_provider(None)?

trace_api.set_tracer_provider(cls.original_provider)

def setUp(self):
self.memory_exporter.clear()