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

Method has_exception

seleniumbase/fixtures/base_case.py:17054–17063  ·  view source on GitHub ↗

(This method should ONLY be used in custom tearDown() methods.) This method returns True if the test failed or raised an exception. This is useful for performing additional steps in your tearDown() method (based on whether or not the test passed or failed). Example us

(self)

Source from the content-addressed store, hash-verified

17052 # Final Trace ("--ftrace")
17053
17054 def has_exception(self):
17055 """(This method should ONLY be used in custom tearDown() methods.)
17056 This method returns True if the test failed or raised an exception.
17057 This is useful for performing additional steps in your tearDown()
17058 method (based on whether or not the test passed or failed).
17059 Example use cases:
17060 * Performing cleanup steps if a test didn't complete.
17061 * Sending test data and/or results to a dashboard service.
17062 """
17063 return self.__has_exception()
17064
17065 def save_teardown_screenshot(self):
17066 """(Should ONLY be used at the start of custom tearDown() methods.)

Callers 1

tearDownMethod · 0.45

Calls 1

__has_exceptionMethod · 0.95

Tested by 1

tearDownMethod · 0.36