@@ -516,7 +516,7 @@ async def test_to_have_values_fails_when_multiple_not_specified(
516516 )
517517 locator = page .locator ("select" )
518518 await locator .select_option (["B" ])
519- with pytest .raises (Error ) as excinfo :
519+ with pytest .raises (AssertionError ) as excinfo :
520520 await expect (locator ).to_have_values (["R" , "G" ], timeout = 500 )
521521 assert "Error: Not a select element with a multiple attribute" in str (excinfo .value )
522522
@@ -530,7 +530,7 @@ async def test_to_have_values_fails_when_not_a_select_element(
530530 """
531531 )
532532 locator = page .locator ("input" )
533- with pytest .raises (Error ) as excinfo :
533+ with pytest .raises (AssertionError ) as excinfo :
534534 await expect (locator ).to_have_values (["R" , "G" ], timeout = 500 )
535535 assert "Error: Not a select element with a multiple attribute" in str (excinfo .value )
536536
@@ -564,7 +564,7 @@ async def test_assertions_boolean_checked_with_intermediate_true_and_checked(
564564 await page .set_content ("<input type=checkbox></input>" )
565565 await page .locator ("input" ).evaluate ("e => e.indeterminate = true" )
566566 with pytest .raises (
567- Error , match = "Can't assert indeterminate and checked at the same time"
567+ AssertionError , match = "Can't assert indeterminate and checked at the same time"
568568 ):
569569 await expect (page .locator ("input" )).to_be_checked (
570570 checked = False , indeterminate = True
@@ -658,7 +658,7 @@ async def test_assertions_locator_to_be_editable_throws(
658658 await page .goto (server .EMPTY_PAGE )
659659 await page .set_content ("<button disabled>Text</button>" )
660660 with pytest .raises (
661- Error ,
661+ AssertionError ,
662662 match = r"Element is not an <input>, <textarea>, <select> or \[contenteditable\] and does not have a role allowing \[aria-readonly\]" ,
663663 ):
664664 await expect (page .locator ("button" )).not_to_be_editable ()
0 commit comments