Skip to content

Commit 492f703

Browse files
authored
Merge pull request #200 from seleniumbase/fix-delayed-asserts
Fix delayed asserts (the error message in the output)
2 parents 99abc63 + f16c97d commit 492f703

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,23 +2520,13 @@ def __get_exception_message(self):
25202520
""" This method extracts the message from an exception if there
25212521
was an exception that occurred during the test, assuming
25222522
that the exception was in a try/except block and not thrown. """
2523-
if sys.version.startswith('3') and hasattr(self, '_outcome'):
2524-
exception_info = self._outcome.errors
2525-
if exception_info:
2526-
try:
2527-
exc_message = exception_info[0][1][1]
2528-
except Exception:
2529-
exc_message = "(Unknown Exception)"
2530-
else:
2531-
exc_message = "(Unknown Exception)"
2523+
exception_info = sys.exc_info()[1]
2524+
if hasattr(exception_info, 'msg'):
2525+
exc_message = exception_info.msg
2526+
elif hasattr(exception_info, 'message'):
2527+
exc_message = exception_info.message
25322528
else:
2533-
exception_info = sys.exc_info()[1]
2534-
if hasattr(exception_info, 'msg'):
2535-
exc_message = exception_info.msg
2536-
elif hasattr(exception_info, 'message'):
2537-
exc_message = exception_info.message
2538-
else:
2539-
exc_message = '(Unknown Exception)'
2529+
exc_message = '(Unknown Exception)'
25402530
return exc_message
25412531

25422532
def __get_improved_exception_message(self):
@@ -2557,6 +2547,7 @@ def __get_improved_exception_message(self):
25572547
"Please go to "
25582548
"https://sites.google.com/a/chromium.org/chromedriver/ "
25592549
"and download the latest version to your system PATH! "
2550+
"Or use: ``seleniumbase install chromedriver`` . "
25602551
"Original Exception Message: %s" % exc_message)
25612552
exc_message = update
25622553
return exc_message

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.15.3',
20+
version='1.15.4',
2121
description='All-In-One Test Automation Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)