From d4ef0063ebbb1b0c4c5f15d5fef62ef2662f626c Mon Sep 17 00:00:00 2001 From: LetzNico Date: Sat, 5 Dec 2020 13:39:33 +0100 Subject: [PATCH] Reset config before/after jaeger export tests Some of its tests set env vars so they can be retrieved in the Configuration; since some modules initialize it at load-time, it needs to be reset before and after tests --- .../tests/test_jaeger_exporter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py index c49a3216884..dc3f7704e9b 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py @@ -41,6 +41,10 @@ def setUp(self): self._test_span = trace._Span("test_span", context=context) self._test_span.start() self._test_span.end() + Configuration._reset() + + def tearDown(self): + Configuration._reset() def test_constructor_default(self): """Test the default values assigned by constructor.""" @@ -142,8 +146,6 @@ def test_constructor_by_environment_variables(self): environ_patcher.stop() - Configuration._reset() - def test_nsec_to_usec_round(self): # pylint: disable=protected-access nsec_to_usec_round = jaeger_exporter._nsec_to_usec_round