Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 546acda

Browse files
committed
python3-ify the test
1 parent 741e19a commit 546acda

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Diff for: tests/test_render.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,30 @@ def setUp(self):
1818

1919
def wait_for_element_by_css_selector(self, selector):
2020
start_time = time.time()
21+
exception = Exception('Time ran out, {} not found'.format(selector))
2122
while time.time() < start_time + 20:
2223
try:
2324
return self.driver.find_element_by_css_selector(selector)
2425
except Exception as e:
26+
exception = e
2527
pass
2628
time.sleep(0.25)
27-
raise e
29+
raise exception
2830

2931
def wait_for_text_to_equal(self, selector, assertion_text):
3032
start_time = time.time()
33+
exception = Exception('Time ran out, {} on {} not found'.format(
34+
assertion_text, selector))
3135
while time.time() < start_time + 20:
3236
el = self.wait_for_element_by_css_selector(selector)
3337
try:
3438
return self.assertEqual(el.text, assertion_text)
3539
except Exception as e:
40+
exception = e
3641
pass
3742
time.sleep(0.25)
3843

39-
raise e
44+
raise exception
4045

4146
def request_queue_assertions(
4247
self, check_rejected=True, expected_length=None):
@@ -1679,7 +1684,7 @@ def test_initialization_with_overlapping_outputs(self):
16791684
def generate_callback(outputid):
16801685
def callback(*args):
16811686
call_counts[outputid].value += 1
1682-
return str(args)
1687+
return '{}, {}'.format(*args)
16831688
return callback
16841689

16851690
for i in range(1, 5):
@@ -1700,7 +1705,7 @@ def callback(*args):
17001705
self.assertEqual(call_counts[outputid].value, 1)
17011706
self.wait_for_text_to_equal(
17021707
'#{}'.format(outputid),
1703-
"(u'input-{}', u'input-{}')".format(i, i+1)
1708+
"input-{}, input-{}".format(i, i+1)
17041709
)
17051710

17061711
def test_generate_overlapping_outputs(self):
@@ -1742,7 +1747,7 @@ def display_output(*args):
17421747
def generate_callback(outputid):
17431748
def callback(*args):
17441749
call_counts[outputid].value += 1
1745-
return str(args)
1750+
return '{}, {}'.format(*args)
17461751
return callback
17471752

17481753
for i in range(1, 5):
@@ -1764,6 +1769,6 @@ def callback(*args):
17641769
self.assertEqual(call_counts[outputid].value, 1)
17651770
self.wait_for_text_to_equal(
17661771
'#{}'.format(outputid),
1767-
"(u'input-{}', u'input-{}')".format(i, i+1)
1772+
"input-{}, input-{}".format(i, i+1)
17681773
)
17691774
self.assertEqual(call_counts['container'].value, 1)

0 commit comments

Comments
 (0)