Skip to content

Commit

Permalink
Fix poor use of pytest.raises in testUnexpectedAlertPresentExceptionC…
Browse files Browse the repository at this point in the history
…ontainsAlertText
  • Loading branch information
davehunt committed Oct 6, 2016
1 parent f83a4b4 commit fcf15f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/test/selenium/webdriver/common/alerts_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ def testUnexpectedAlertPresentExceptionContainsAlertText(self, driver, pages):
value = alert.text
with pytest.raises(UnexpectedAlertPresentException) as e:
pages.load("simpleTest.html")
assert value == e.alert_text
assert str(e).startswith("Alert Text: %s" % value)
assert value == e.value.alert_text
assert "Alert Text: {}".format(value) in str(e)

def _waitForAlert(self, driver):
return WebDriverWait(driver, 3).until(EC.alert_is_present())

0 comments on commit fcf15f5

Please sign in to comment.