@@ -3338,7 +3338,7 @@ def assert_text_not_visible(self, text, selector="body", timeout=None):
33383338 def assert_true (self , expression , msg = None ):
33393339 if not expression :
33403340 if not msg :
3341- raise AssertionError ("%s is not true" % expression )
3341+ raise AssertionError ("%s is not true. " % expression )
33423342 else :
33433343 raise AssertionError (
33443344 "%s is not true. (%s)" % (expression , msg )
@@ -3347,27 +3347,48 @@ def assert_true(self, expression, msg=None):
33473347 def assert_false (self , expression , msg = None ):
33483348 if expression :
33493349 if not msg :
3350- raise AssertionError ("%s is not false" % expression )
3350+ raise AssertionError ("%s is not false. " % expression )
33513351 else :
33523352 raise AssertionError (
33533353 "%s is not false. (%s)" % (expression , msg )
33543354 )
33553355
3356- def assert_equal (self , first , second ):
3356+ def assert_equal (self , first , second , msg = None ):
33573357 if first != second :
3358- raise AssertionError ("%s is not equal to %s" % (first , second ))
3358+ if not msg :
3359+ raise AssertionError (
3360+ "%s is not equal to %s." % (first , second )
3361+ )
3362+ else :
3363+ raise AssertionError (
3364+ "%s is not equal to %s. (%s)" % (first , second , msg ))
33593365
3360- def assert_not_equal (self , first , second ):
3366+ def assert_not_equal (self , first , second , msg = None ):
33613367 if first == second :
3362- raise AssertionError ("%s is equal to %s" % (first , second ))
3368+ if not msg :
3369+ raise AssertionError ("%s is equal to %s." % (first , second ))
3370+ else :
3371+ raise AssertionError (
3372+ "%s is equal to %s. (%s)" % (first , second , msg )
3373+ )
33633374
3364- def assert_in (self , first , second ):
3375+ def assert_in (self , first , second , msg = None ):
33653376 if first not in second :
3366- raise AssertionError ("%s is not in %s" % (first , second ))
3377+ if not msg :
3378+ raise AssertionError ("%s is not in %s." % (first , second ))
3379+ else :
3380+ raise AssertionError (
3381+ "%s is not in %s. (%s)" % (first , second , msg )
3382+ )
33673383
3368- def assert_not_in (self , first , second ):
3384+ def assert_not_in (self , first , second , msg = None ):
33693385 if first in second :
3370- raise AssertionError ("%s is in %s" % (first , second ))
3386+ if not msg :
3387+ raise AssertionError ("%s is in %s." % (first , second ))
3388+ else :
3389+ raise AssertionError (
3390+ "%s is in %s. (%s)" % (first , second , msg )
3391+ )
33713392
33723393 def js_scroll_into_view (self , selector ):
33733394 css_selector = self .__convert_to_css_if_xpath (selector )
0 commit comments