Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Make it a bit easier to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Mar 29, 2017
1 parent 6786d35 commit 3c1e47e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gratipay/testing/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def wait_to_disappear(self, selector, timeout=2):
while time.time() < end_time:
if not self.has_element(selector):
return
raise NeverLeft()
raise NeverLeft(selector)

def wait_for(self, selector, timeout=2):
"""Wait up to ``timeout`` seconds for element specified by ``selector``
Expand All @@ -109,7 +109,7 @@ def wait_for(self, selector, timeout=2):
while time.time() < end_time:
if self.has_element(selector):
return self.find_by_css(selector)
raise NeverShowedUp()
raise NeverShowedUp(selector)

def wait_for_notification(self, type='notice'):
"""Wait for a certain ``type`` of notification. Dismiss the
Expand Down
14 changes: 14 additions & 0 deletions tests/py/test_testing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import traceback

from gratipay.testing.browser import NeverLeft


def test_fail_repr():
try:
raise NeverLeft('.some.selector')
except:
formatted = traceback.format_exc()
assert 'NeverLeft: .some.selector' in formatted

0 comments on commit 3c1e47e

Please sign in to comment.