From 5db72ff22f534f5bc8822926fcd6e8f35861a98f Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Sat, 27 Jul 2024 17:46:50 -0400 Subject: [PATCH] fix flaky test --- electionpage/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electionpage/tests.py b/electionpage/tests.py index 830c6a17..9243b042 100644 --- a/electionpage/tests.py +++ b/electionpage/tests.py @@ -118,8 +118,8 @@ def test_election_pages(self): self.assertEqual(bargraphButton.get_attribute('class'), 'btn btn-primary') # And the height was correctly set via PostMessages - self.assertEqual(bargraphIframeWrapper.find_element( - By.TAG_NAME, 'iframe').get_attribute('height'), '328px') + self._ensure_eventually_asserts(lambda: self.assertEqual(bargraphIframeWrapper.find_element( + By.TAG_NAME, 'iframe').get_attribute('height'), '328px')) @Mocker() def test_scrape_all(self, requestMock):