summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2007-08-29 10:28:28 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2007-08-29 10:28:28 (GMT)
commit492e5920bc8a6d07be7f9b251bdc2482f043e48d (patch)
tree0cd4794a11b0f1d0a6951a8f95d5a28bc6c17c1d /Lib
parent4a40f0ceb7693621de262588d620da658436b9f2 (diff)
downloadcpython-492e5920bc8a6d07be7f9b251bdc2482f043e48d.zip
cpython-492e5920bc8a6d07be7f9b251bdc2482f043e48d.tar.gz
cpython-492e5920bc8a6d07be7f9b251bdc2482f043e48d.tar.bz2
Ignore test failures caused by 'resource temporarily unavailable'
exceptions raised during FailingServerTestCase tests. [GSoC - Alan McIntyre]
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_xmlrpc.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index 9282581..1f0eac5 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -483,8 +483,10 @@ class FailingServerTestCase(unittest.TestCase):
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 @@ class FailingServerTestCase(unittest.TestCase):
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 @@ class FailingServerTestCase(unittest.TestCase):
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')