@@ -489,11 +489,7 @@ def raise_exception_handler(json_input, lambda_context):
489489 )
490490
491491 # NOTE: Indentation characters are NO-BREAK SPACE (U+00A0) not SPACE (U+0020)
492- error_logs = (
493- lambda_unhandled_exception_warning_message
494- + "\n "
495- + "[ERROR] FaultExceptionType: Fault exception msg\r "
496- )
492+ error_logs = "[ERROR] FaultExceptionType: Fault exception msg\r "
497493 error_logs += "Traceback (most recent call last):\r "
498494 error_logs += ' File "spam.py", line 3, in <module>\r '
499495 error_logs += " spam.eggs()\r "
@@ -527,11 +523,7 @@ def raise_exception_handler(json_input, lambda_context):
527523 "tenant_id" ,
528524 bootstrap .StandardLogSink (),
529525 )
530- error_logs = (
531- lambda_unhandled_exception_warning_message
532- + "\n "
533- + "[ERROR] FaultExceptionType: Fault exception msg\r Traceback (most recent call last):\n "
534- )
526+ error_logs = "[ERROR] FaultExceptionType: Fault exception msg\r Traceback (most recent call last):\n "
535527
536528 self .assertEqual (mock_stdout .getvalue (), error_logs )
537529
@@ -560,11 +552,7 @@ def raise_exception_handler(json_input, lambda_context):
560552 "tenant_id" ,
561553 bootstrap .StandardLogSink (),
562554 )
563- error_logs = (
564- lambda_unhandled_exception_warning_message
565- + "\n "
566- + "[ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
567- )
555+ error_logs = "[ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
568556
569557 self .assertEqual (mock_stdout .getvalue (), error_logs )
570558
@@ -593,11 +581,7 @@ def raise_exception_handler(json_input, lambda_context):
593581 "tenant_id" ,
594582 bootstrap .StandardLogSink (),
595583 )
596- error_logs = (
597- lambda_unhandled_exception_warning_message
598- + "\n "
599- + "[ERROR] Fault exception msg\r Traceback (most recent call last):\n "
600- )
584+ error_logs = "[ERROR] Fault exception msg\r Traceback (most recent call last):\n "
601585
602586 self .assertEqual (mock_stdout .getvalue (), error_logs )
603587
@@ -635,7 +619,7 @@ def raise_exception_handler(json_input, lambda_context):
635619 "tenant_id" ,
636620 bootstrap .StandardLogSink (),
637621 )
638- error_logs = lambda_unhandled_exception_warning_message + " \n [ERROR]\r "
622+ error_logs = " [ERROR]\r "
639623 error_logs += "Traceback (most recent call last):\r "
640624 error_logs += ' File "spam.py", line 3, in <module>\r '
641625 error_logs += " spam.eggs()\r "
@@ -671,21 +655,11 @@ def raise_exception_handler(json_input, lambda_context):
671655 )
672656
673657 stdout_value = mock_stdout .getvalue ()
674- received_warning = stdout_value .split ("\n " )[0 ]
675- received_rest = stdout_value [len (received_warning ) + 1 :]
676-
677- warning = json .loads (received_warning )
678- self .assertEqual (warning ["level" ], "WARNING" )
679- self .assertEqual (warning ["message" ], lambda_unhandled_exception_warning_message )
680- self .assertEqual (warning ["logger" ], "root" )
681- self .assertIn ("timestamp" , warning )
682658
683659 # this line is not in json because of the way the test runtime is bootstrapped
684- error_logs = (
685- "\n [ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
686- )
660+ error_logs = "[ERROR] FaultExceptionType\r Traceback (most recent call last):\n "
687661
688- self .assertEqual (received_rest , error_logs )
662+ self .assertEqual (stdout_value , error_logs )
689663
690664
691665class TestXrayFault (unittest .TestCase ):
0 commit comments