MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / __has_exception

Method __has_exception

seleniumbase/fixtures/base_case.py:16491–16515  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16489 self._drivers_list = []
16490
16491 def __has_exception(self):
16492 has_exception = False
16493 if hasattr(sys, "last_traceback") and sys.last_traceback is not None:
16494 has_exception = True
16495 elif getattr(self, "is_context_manager", None):
16496 if self.with_testing_base and self._has_failure:
16497 return True
16498 else:
16499 return False
16500 elif hasattr(self, "_outcome") and hasattr(self._outcome, "errors"):
16501 if python3_11_or_newer:
16502 if (
16503 self._outcome.errors
16504 and self._outcome.errors[-1]
16505 and self._outcome.errors[-1][1]
16506 ):
16507 has_exception = True
16508 else:
16509 if self._outcome.errors:
16510 has_exception = True
16511 else:
16512 has_exception = sys.exc_info()[1] is not None
16513 if self.__will_be_skipped and hasattr(self, "_using_sb_fixture"):
16514 has_exception = False
16515 return has_exception
16516
16517 def __get_test_id(self):
16518 """The id used in various places such as the test log path."""

Callers 4

__delay_driver_quitMethod · 0.95
has_exceptionMethod · 0.95
tearDownMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected