[Python-checkins] r57651 - python/trunk/Lib/test/test_xmlrpc.py

facundo.batista python-checkins at python.org
Wed Aug 29 12:28:28 CEST 2007


Author: facundo.batista
Date: Wed Aug 29 12:28:28 2007
New Revision: 57651

Modified:
   python/trunk/Lib/test/test_xmlrpc.py
Log:

Ignore test failures caused by 'resource temporarily unavailable'
exceptions raised during FailingServerTestCase tests.
[GSoC - Alan McIntyre]


Modified: python/trunk/Lib/test/test_xmlrpc.py
==============================================================================
--- python/trunk/Lib/test/test_xmlrpc.py	(original)
+++ python/trunk/Lib/test/test_xmlrpc.py	Wed Aug 29 12:28:28 2007
@@ -483,8 +483,10 @@
             p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
             self.assertEqual(p.pow(6,8), 6**8)
         except xmlrpclib.ProtocolError, e:
-            # protocol error; provide additional information in test output
-            self.fail("%s\n%s" % (e, e.headers))
+            # ignore failures due to non-blocking socket 'unavailable' errors
+            if not is_unavailable_exception(e):
+                # protocol error; provide additional information in test output
+                self.fail("%s\n%s" % (e, e.headers))
 
     def test_fail_no_info(self):
         # use the broken message class
@@ -494,9 +496,11 @@
             p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
             p.pow(6,8)
         except xmlrpclib.ProtocolError, e:
-            # The two server-side error headers shouldn't be sent back in this case
-            self.assertTrue(e.headers.get("X-exception") is None)
-            self.assertTrue(e.headers.get("X-traceback") is None)
+            # ignore failures due to non-blocking socket 'unavailable' errors
+            if not is_unavailable_exception(e):
+                # The two server-side error headers shouldn't be sent back in this case
+                self.assertTrue(e.headers.get("X-exception") is None)
+                self.assertTrue(e.headers.get("X-traceback") is None)
         else:
             self.fail('ProtocolError not raised')
 
@@ -512,10 +516,12 @@
             p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
             p.pow(6,8)
         except xmlrpclib.ProtocolError, e:
-            # We should get error info in the response
-            expected_err = "invalid literal for int() with base 10: 'I am broken'"
-            self.assertEqual(e.headers.get("x-exception"), expected_err)
-            self.assertTrue(e.headers.get("x-traceback") is not None)
+            # ignore failures due to non-blocking socket 'unavailable' errors
+            if not is_unavailable_exception(e):
+                # We should get error info in the response
+                expected_err = "invalid literal for int() with base 10: 'I am broken'"
+                self.assertEqual(e.headers.get("x-exception"), expected_err)
+                self.assertTrue(e.headers.get("x-traceback") is not None)
         else:
             self.fail('ProtocolError not raised')
 


More information about the Python-checkins mailing list