Skip to content

Commit a572324

Browse files
committed
Update exception-handling
1 parent 8a528fb commit a572324

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6360,13 +6360,13 @@ def assert_pdf_text(
63606360
)
63616361
if type(page) is int:
63626362
if text not in pdf_text:
6363-
raise Exception(
6363+
self.fail(
63646364
"PDF [%s] is missing expected text [%s] on "
63656365
"page [%s]!" % (pdf, text, page)
63666366
)
63676367
else:
63686368
if text not in pdf_text:
6369-
raise Exception(
6369+
self.fail(
63706370
"PDF [%s] is missing expected text [%s]!" % (pdf, text)
63716371
)
63726372
return True
@@ -7115,7 +7115,7 @@ def assert_no_js_errors(self, exclude=[]):
71157115
er_str = str(errors)
71167116
er_str = er_str.replace("[{", "[\n{").replace("}, {", "},\n{")
71177117
current_url = self.get_current_url()
7118-
raise Exception(
7118+
self.fail(
71197119
"JavaScript errors found on %s => %s" % (current_url, er_str)
71207120
)
71217121
if self.demo_mode:
@@ -7670,7 +7670,7 @@ def reset_default_timeout(self):
76707670

76717671
def fail(self, msg="fail() called!"):
76727672
"""Fail immediately, with the given message."""
7673-
raise self.failureException(msg)
7673+
super().fail(msg)
76747674

76757675
def skip(self, reason=""):
76767676
"""Mark the test as Skipped."""

0 commit comments

Comments
 (0)