Skip to content

Commit 841f7ea

Browse files
fix: update exception handler test for Python 3.13 traceback format compatibility
Co-Authored-By: AJ Steers <[email protected]>
1 parent 6536aa4 commit 841f7ea

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

unit_tests/test_exception_handler.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,21 @@ def test_given_exception_with_display_message_when_assemble_uncaught_exception_t
4747
def test_uncaught_exception_handler():
4848
cmd = "from airbyte_cdk.logger import init_logger; from airbyte_cdk.exception_handler import init_uncaught_exception_handler; logger = init_logger('airbyte'); init_uncaught_exception_handler(logger); raise 1"
4949
exception_message = "exceptions must derive from BaseException"
50-
exception_trace = (
51-
"Traceback (most recent call last):\n"
52-
' File "<string>", line 1, in <module>\n'
53-
"TypeError: exceptions must derive from BaseException"
54-
)
50+
51+
if sys.version_info >= (3, 13):
52+
exception_trace = (
53+
"Traceback (most recent call last):\n"
54+
' File "<string>", line 1, in <module>\n'
55+
" from airbyte_cdk.logger import init_logger; from airbyte_cdk.exception_handler import init_uncaught_exception_handler; logger = init_logger('airbyte'); init_uncaught_exception_handler(logger); raise 1\n"
56+
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"
57+
"TypeError: exceptions must derive from BaseException"
58+
)
59+
else:
60+
exception_trace = (
61+
"Traceback (most recent call last):\n"
62+
' File "<string>", line 1, in <module>\n'
63+
"TypeError: exceptions must derive from BaseException"
64+
)
5565

5666
expected_log_message = AirbyteMessage(
5767
type=MessageType.LOG,

0 commit comments

Comments
 (0)