(self, state, err)
| 16362 | return str(exc_message) |
| 16363 | |
| 16364 | def __insert_test_result(self, state, err): |
| 16365 | from seleniumbase.core.testcase_manager import TestcaseDataPayload |
| 16366 | |
| 16367 | data_payload = TestcaseDataPayload() |
| 16368 | data_payload.runtime = int(time.time() * 1000.0) - self.case_start_time |
| 16369 | data_payload.guid = self.testcase_guid |
| 16370 | data_payload.execution_guid = self.execution_guid |
| 16371 | data_payload.state = state |
| 16372 | if err: |
| 16373 | import traceback |
| 16374 | tb_string = traceback.format_exc() |
| 16375 | if "Message: " in tb_string: |
| 16376 | data_payload.message = ( |
| 16377 | "Message: " + tb_string.split("Message: ")[-1] |
| 16378 | ) |
| 16379 | elif "Exception: " in tb_string: |
| 16380 | data_payload.message = tb_string.split("Exception: ")[-1] |
| 16381 | elif "Error: " in tb_string: |
| 16382 | data_payload.message = tb_string.split("Error: ")[-1] |
| 16383 | else: |
| 16384 | data_payload.message = self.__get_exception_info() |
| 16385 | else: |
| 16386 | test_id = self.__get_test_id_2() |
| 16387 | if ( |
| 16388 | self.is_pytest |
| 16389 | and test_id in sb_config._results.keys() |
| 16390 | and (sb_config._results[test_id] == "Skipped") |
| 16391 | ): |
| 16392 | if self.__skip_reason: |
| 16393 | data_payload.message = "Skipped: " + self.__skip_reason |
| 16394 | else: |
| 16395 | data_payload.message = "Skipped: (no reason given)" |
| 16396 | self.testcase_manager.update_testcase_data(data_payload) |
| 16397 | |
| 16398 | def _add_pytest_html_extra(self): |
| 16399 | if not ( |
no test coverage detected