Skip to content

Commit 999f056

Browse files
Revised test cases
1 parent 9844ccb commit 999f056

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

tests/observability/core/test_agent365.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,13 @@ def test_configure_uses_existing_tracer_provider(self, mock_get_provider, mock_i
201201
self.assertIn("_EnrichingBatchSpanProcessor", processor_types)
202202
self.assertIn("SpanProcessor", processor_types)
203203

204-
205-
class TestOTLPExporterConfiguration(unittest.TestCase):
206-
"""Test suite for OTLP exporter configuration based on environment variables."""
207-
208204
@patch("microsoft_agents_a365.observability.core.config.OTLPSpanExporter")
209205
@patch(
210206
"microsoft_agents_a365.observability.core.config.is_agent365_exporter_enabled",
211207
return_value=False,
212208
)
213-
@patch("microsoft_agents_a365.observability.core.config.TelemetryManager._instance", None)
214209
@patch.dict("os.environ", {"OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4318"}, clear=True)
215-
def test_otlp_exporter_initialized_when_env_var_set(self, mock_is_enabled, mock_otlp_exporter):
210+
def test_otlp_exporter_initialized_when_env_var_set(self, mock_otlp_exporter):
216211
"""Test that OTLPSpanExporter is initialized when OTEL_EXPORTER_OTLP_ENDPOINT is set."""
217212

218213
result = configure(
@@ -228,11 +223,8 @@ def test_otlp_exporter_initialized_when_env_var_set(self, mock_is_enabled, mock_
228223
"microsoft_agents_a365.observability.core.config.is_agent365_exporter_enabled",
229224
return_value=False,
230225
)
231-
@patch("microsoft_agents_a365.observability.core.config.TelemetryManager._instance", None)
232226
@patch.dict("os.environ", {}, clear=True)
233-
def test_otlp_exporter_not_initialized_when_env_var_not_set(
234-
self, mock_is_enabled, mock_otlp_exporter
235-
):
227+
def test_otlp_exporter_not_initialized_when_env_var_not_set(self, mock_otlp_exporter):
236228
"""Test that OTLPSpanExporter is NOT initialized when OTEL_EXPORTER_OTLP_ENDPOINT is not set."""
237229

238230
result = configure(

0 commit comments

Comments
 (0)