diff --git a/opentelemetry-sdk/tests/trace/test_trace.py b/opentelemetry-sdk/tests/trace/test_trace.py index a6683ebd03..24621a5978 100644 --- a/opentelemetry-sdk/tests/trace/test_trace.py +++ b/opentelemetry-sdk/tests/trace/test_trace.py @@ -15,7 +15,6 @@ # pylint: disable=too-many-lines import shutil import subprocess -import sys import unittest from importlib import reload from logging import ERROR, WARNING @@ -1187,13 +1186,6 @@ def test_record_exception_context_manager(self): stacktrace = """in test_record_exception_context_manager raise RuntimeError("example error") RuntimeError: example error""" - if sys.version_info >= (3, 11): - # https://docs.python.org/3.11/whatsnew/3.11.html#enhanced-error-locations-in-tracebacks - tracelines = stacktrace.splitlines() - tracelines.insert( - -1, " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" - ) - stacktrace = "\n".join(tracelines) self.assertIn(stacktrace, event.attributes["exception.stacktrace"]) try: