Skip to content

Commit 3a7d797

Browse files
committed
Improve reliability of asserting that there are no 404-errors
1 parent 030f636 commit 3a7d797

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2758,7 +2758,12 @@ def assert_link_status_code_is_not_404(self, link):
27582758
def __get_link_if_404_error(self, link):
27592759
status_code = str(self.get_link_status_code(link))
27602760
if status_code == "404":
2761-
return link
2761+
# Verify again to be sure. (In case of multi-threading overload.)
2762+
status_code = str(self.get_link_status_code(link))
2763+
if status_code == "404":
2764+
return link
2765+
else:
2766+
return None
27622767
else:
27632768
return None
27642769

0 commit comments

Comments
 (0)