File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
opentelemetry-api/tests/propagators Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,21 @@ def test_propagators(propagators):
5252 @patch .dict (environ , {OTEL_PROPAGATORS : "none" })
5353 @patch ("opentelemetry.propagators.composite.CompositePropagator" )
5454 def test_no_propagators_loaded (self , mock_compositehttppropagator ):
55- def test_propagators (propagators ):
56- self .assertEqual (
57- propagators , []
58- ) # Expecting an empty list of propagators
55+ # Verify if exception is raised without the fix
56+ with self .assertRaises (Exception ):
57+ from opentelemetry .propagate import get_global_textmap
5958
60- mock_compositehttppropagator .configure_mock (
61- ** {"side_effect" : test_propagators }
62- )
59+ get_global_textmap ()
60+
61+ # Apply fix and verify propagators is empty, with no exception raised
62+ try :
63+ from opentelemetry .propagate import get_global_textmap
64+
65+ mock_compositehttppropagator .assert_called_with (
66+ []
67+ ) # Validate empty list of propagators
68+ except Exception as e :
69+ self .fail (f"Test failed unexpectedly with an exception: { e } " )
6370
6471 @patch .dict (environ , {OTEL_PROPAGATORS : "a, b, c " })
6572 @patch ("opentelemetry.propagators.composite.CompositePropagator" )
You can’t perform that action at this time.
0 commit comments