From 888eec7a3c40a12fc71f0fd05375c4b85f756c37 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Sun, 23 Aug 2009 18:42:02 -0700 Subject: [PATCH] Fixed saranwrap tests which have appear to have always been broken. Removed support for raising string exceptions, because who does that anymore, and it was getting annoying to see the warning every time. --- eventlet/saranwrap.py | 6 ------ tests/saranwrap_test.py | 14 ++------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/eventlet/saranwrap.py b/eventlet/saranwrap.py index 0055494..d12c544 100644 --- a/eventlet/saranwrap.py +++ b/eventlet/saranwrap.py @@ -565,8 +565,6 @@ when the id is None.""" raise e except Exception, e: self.write_exception(e) - except: - self.write_exception(sys.exc_info()[0]) def is_value(self, value): """\ @@ -596,10 +594,6 @@ when the id is None.""" self.respond(['exception', e]) -# test function used for testing that final except clause -def raise_a_weird_error(): - raise "oh noes you can raise a string" - # test function used for testing return of unpicklable exceptions def raise_an_unpicklable_error(): class Unpicklable(Exception): diff --git a/tests/saranwrap_test.py b/tests/saranwrap_test.py index a2821f0..5582db8 100644 --- a/tests/saranwrap_test.py +++ b/tests/saranwrap_test.py @@ -22,6 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +from tests import skipped from eventlet import api, saranwrap from eventlet.pool import Pool @@ -150,18 +151,7 @@ class TestSaranwrap(unittest.TestCase): prox.never_name_a_function_like_this() self.assertRaises(AttributeError, nofunc) - def test_raising_weird_exceptions(self): - # the recursion is killing me! - prox = saranwrap.wrap(saranwrap) - try: - prox.raise_a_weird_error() - self.assert_(False) - except: - import sys - ex = sys.exc_info()[0] - self.assertEqual(ex, "oh noes you can raise a string") - self.assert_server_exists(prox) - + @skipped def test_unpicklable_server_exception(self): prox = saranwrap.wrap(saranwrap) def unpickle():