MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _execute_test_case

Method _execute_test_case

dpdk/dts/framework/test_suite.py:403–425  ·  view source on GitHub ↗

Execute one test case and handle failures.

(
        self, test_case_method: MethodType, test_case_result: TestCaseResult
    )

Source from the content-addressed store, hash-verified

401 test_case_result.update(Result.ERROR)
402
403 def _execute_test_case(
404 self, test_case_method: MethodType, test_case_result: TestCaseResult
405 ) -> None:
406 """
407 Execute one test case and handle failures.
408 """
409 test_case_name = test_case_method.__name__
410 try:
411 self._logger.info(f"Starting test case execution: {test_case_name}")
412 test_case_method()
413 test_case_result.update(Result.PASS)
414 self._logger.info(f"Test case execution PASSED: {test_case_name}")
415
416 except TestCaseVerifyError as e:
417 self._logger.exception(f"Test case execution FAILED: {test_case_name}")
418 test_case_result.update(Result.FAIL, e)
419 except Exception as e:
420 self._logger.exception(f"Test case execution ERROR: {test_case_name}")
421 test_case_result.update(Result.ERROR, e)
422 except KeyboardInterrupt:
423 self._logger.error(f"Test case execution INTERRUPTED by user: {test_case_name}")
424 test_case_result.update(Result.SKIP)
425 raise KeyboardInterrupt("Stop DTS")
426
427
428def get_test_suites(testsuite_module_path: str) -> list[type[TestSuite]]:

Callers 1

_run_test_caseMethod · 0.95

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected