diff --git a/opentelemetry-sdk/tests/trace/test_trace.py b/opentelemetry-sdk/tests/trace/test_trace.py index d4ee490f39..2c6fdf3f92 100644 --- a/opentelemetry-sdk/tests/trace/test_trace.py +++ b/opentelemetry-sdk/tests/trace/test_trace.py @@ -2231,6 +2231,7 @@ def test_parent_child_span_exception(self): exception_type = exception.__class__.__name__ exception_message = exception.args[0] + child_span = None try: with tracer.start_as_current_span( "parent", @@ -2245,6 +2246,8 @@ def test_parent_child_span_exception(self): except Exception: # pylint: disable=broad-exception-caught pass + self.assertIsNotNone(child_span) + self.assertTrue(child_span.status.is_ok) self.assertIsNone(child_span.status.description) self.assertTupleEqual(child_span.events, ()) @@ -2275,6 +2278,7 @@ def test_child_parent_span_exception(self): exception = Exception("exception") + child_span = None try: with tracer.start_as_current_span( "parent", @@ -2290,6 +2294,8 @@ def test_child_parent_span_exception(self): except Exception: # pylint: disable=broad-exception-caught pass + self.assertIsNotNone(child_span) + self.assertTrue(child_span.status.is_ok) self.assertIsNone(child_span.status.description) self.assertTupleEqual(child_span.events, ())