@@ -437,6 +437,16 @@ def helper__makereport__setup(
437437return
438438
439439
440+ # ------------------------------------------------------------------------
441+ class ExitStatusNames :
442+ FAILED = "FAILED"
443+ PASSED = "PASSED"
444+ XFAILED = "XFAILED"
445+ NOT_XFAILED = "NOT XFAILED"
446+ SKIPPED = "SKIPPED"
447+ UNEXPECTED = "UNEXPECTED"
448+
449+
440450# ------------------------------------------------------------------------
441451def helper__makereport__call (
442452item :pytest .Function ,call :pytest .CallInfo ,outcome :T_PLUGGY_RESULT
@@ -486,28 +496,29 @@ def helper__makereport__call(
486496
487497# --------
488498exitStatus = None
499+ exitStatusInfo = None
489500if rep .outcome == "skipped" :
490501assert call .excinfo is not None # research
491502assert call .excinfo .value is not None # research
492503
493504if type (call .excinfo .value )== _pytest .outcomes .Skipped :# noqa: E721
494505assert not hasattr (rep ,"wasxfail" )
495506
496- exitStatus = " SKIPPED"
507+ exitStatus = ExitStatusNames . SKIPPED
497508reasonText = str (call .excinfo .value )
498509reasonMsgTempl = "SKIP REASON: {0}"
499510
500511TEST_PROCESS_STATS .incrementSkippedTestCount ()
501512
502- elif type (call .excinfo .value )== _pytest .outcomes .XFailed :# noqa: E721
503- exitStatus = " XFAILED"
513+ elif type (call .excinfo .value )== _pytest .outcomes .XFailed :# noqa: E721 E501
514+ exitStatus = ExitStatusNames . XFAILED
504515reasonText = str (call .excinfo .value )
505516reasonMsgTempl = "XFAIL REASON: {0}"
506517
507518TEST_PROCESS_STATS .incrementXFailedTestCount (testID ,item_error_msg_count )
508519
509520else :
510- exitStatus = " XFAILED"
521+ exitStatus = ExitStatusNames . XFAILED
511522assert hasattr (rep ,"wasxfail" )
512523assert rep .wasxfail is not None
513524assert type (rep .wasxfail )== str # noqa: E721
@@ -544,7 +555,7 @@ def helper__makereport__call(
544555assert item_error_msg_count > 0
545556TEST_PROCESS_STATS .incrementFailedTestCount (testID ,item_error_msg_count )
546557
547- exitStatus = " FAILED"
558+ exitStatus = ExitStatusNames . FAILED
548559elif rep .outcome == "passed" :
549560assert call .excinfo is None
550561
@@ -559,22 +570,31 @@ def helper__makereport__call(
559570warnMsg += " [" + rep .wasxfail + "]"
560571
561572logging .info (warnMsg )
562- exitStatus = "NOT XFAILED"
573+ exitStatus = ExitStatusNames . NOT_XFAILED
563574else :
564575assert not hasattr (rep ,"wasxfail" )
565576
566577TEST_PROCESS_STATS .incrementPassedTestCount ()
567- exitStatus = " PASSED"
578+ exitStatus = ExitStatusNames . PASSED
568579else :
569580TEST_PROCESS_STATS .incrementUnexpectedTests ()
570- exitStatus = "UNEXPECTED [{0}]" .format (rep .outcome )
581+ exitStatus = ExitStatusNames .UNEXPECTED
582+ exitStatusInfo = rep .outcome
571583# [2025-03-28] It may create a useless problem in new environment.
572584# assert False
573585
574586# --------
575587if item_warning_msg_count > 0 :
576588TEST_PROCESS_STATS .incrementWarningTestCount (testID ,item_warning_msg_count )
577589
590+ # --------
591+ assert exitStatus is not None
592+ assert type (exitStatus )== str # noqa: E721
593+
594+ if exitStatus == ExitStatusNames .FAILED :
595+ assert item_error_msg_count > 0
596+ pass
597+
578598# --------
579599assert type (TEST_PROCESS_STATS .cTotalDuration )== datetime .timedelta # noqa: E721
580600assert type (testDurration )== datetime .timedelta # noqa: E721
@@ -583,11 +603,17 @@ def helper__makereport__call(
583603
584604assert testDurration <= TEST_PROCESS_STATS .cTotalDuration
585605
606+ # --------
607+ exitStatusLineData = exitStatus
608+
609+ if exitStatusInfo is not None :
610+ exitStatusLineData += " [{}]" .format (exitStatusInfo )
611+
586612# --------
587613logging .info ("*" )
588614logging .info ("* DURATION : {0}" .format (timedelta_to_human_text (testDurration )))
589615logging .info ("*" )
590- logging .info ("* EXIT STATUS : {0}" .format (exitStatus ))
616+ logging .info ("* EXIT STATUS : {0}" .format (exitStatusLineData ))
591617logging .info ("* ERROR COUNT : {0}" .format (item_error_msg_count ))
592618logging .info ("* WARNING COUNT: {0}" .format (item_warning_msg_count ))
593619logging .info ("*" )