@@ -226,6 +226,17 @@ def test_otlp_headers_from_env(self, mock_ssl_channel, mock_secure):
226
226
227
227
# pylint: disable=no-self-use
228
228
def test_otlp_compression_from_env (self ):
229
+ # Just OTEL_EXPORTER_OTLP_COMPRESSION should work
230
+ with patch (
231
+ "opentelemetry.exporter.otlp.exporter.insecure_channel"
232
+ ) as mock_insecure_channel , patch .dict (
233
+ "os.environ" , {OTEL_EXPORTER_OTLP_COMPRESSION : "deflate" }
234
+ ):
235
+ OTLPSpanExporter (insecure = True )
236
+ mock_insecure_channel .assert_called_once_with (
237
+ "localhost:4317" , compression = Compression .Deflate
238
+ )
239
+
229
240
# Specifying kwarg should take precedence over env
230
241
with patch (
231
242
"opentelemetry.exporter.otlp.exporter.insecure_channel"
@@ -248,17 +259,6 @@ def test_otlp_compression_from_env(self):
248
259
"localhost:4317" , compression = Compression .NoCompression
249
260
)
250
261
251
- # Just OTEL_EXPORTER_OTLP_COMPRESSION should work
252
- with patch (
253
- "opentelemetry.exporter.otlp.exporter.insecure_channel"
254
- ) as mock_insecure_channel , patch .dict (
255
- "os.environ" , {OTEL_EXPORTER_OTLP_COMPRESSION : "deflate" }
256
- ):
257
- OTLPSpanExporter (insecure = True )
258
- mock_insecure_channel .assert_called_once_with (
259
- "localhost:4317" , compression = Compression .Deflate
260
- )
261
-
262
262
# OTEL_EXPORTER_OTLP_SPAN_COMPRESSION as higher priority than
263
263
# OTEL_EXPORTER_OTLP_COMPRESSION
264
264
with patch (
0 commit comments