File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,30 @@ def f():
484484 assert exporter .credentials is credential_for_traces_only
485485 assert exporter .credentials is not credential_for_all_signals
486486
487+ @patch .dict (
488+ environ ,
489+ {
490+ OTEL_PYTHON_EXPORTER_OTLP_TRACES_CREDENTIAL_PROVIDER : "custom_credential"
491+ },
492+ )
493+ @patch ("opentelemetry.sdk._configuration.entry_points" )
494+ def test_that_invalid_credential_type_raises_exception (
495+ self , mock_entry_points
496+ ):
497+ def f ():
498+ # Entry point must return a grpc.ChannelCredential or requests.Session.
499+ return 32
500+
501+ mock_entry_points .configure_mock (
502+ return_value = [IterEntryPoint ("custom_credential" , f )]
503+ )
504+ with raises (RuntimeError ):
505+ _init_exporter (
506+ "traces" ,
507+ {},
508+ OTLPSpanExporter ,
509+ )
510+
487511 @patch .dict (
488512 "os.environ" , {OTEL_TRACES_SAMPLER : "non_existent_entry_point" }
489513 )
You can’t perform that action at this time.
0 commit comments