From dd9dd041b81635e0231ac8751d633f10deb126a6 Mon Sep 17 00:00:00 2001 From: Christopher Foo Date: Thu, 19 Feb 2015 18:13:42 -0500 Subject: [PATCH] http.client_test: Handle case with multiple warnings --- wpull/http/client_test.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wpull/http/client_test.py b/wpull/http/client_test.py index 7c8f295e..768591a4 100644 --- a/wpull/http/client_test.py +++ b/wpull/http/client_test.py @@ -158,7 +158,15 @@ def test_client_did_not_complete(self): for warn_obj in warn_list: print(warn_obj) - self.assertEqual(1, len(warn_list)) + # Unrelated warnings may occur in PyPy + # https://travis-ci.org/chfoo/wpull/jobs/51420202 + self.assertGreaterEqual(1, len(warn_list)) + + for warn_obj in warn_list: + if str(warn_obj.message) == 'HTTP session did not complete.': + break + else: + self.fail('Warning did not occur.') client = Client()