Skipping saranwrap tests on pyevent hub....saranwrap's going to go away soon anyhow.

This commit is contained in:
Ryan Williams
2010-02-22 16:52:02 -05:00
parent 2a4ac0fd28
commit cd20f97448

View File

@@ -6,7 +6,7 @@ import eventlet
import sys import sys
import tempfile import tempfile
import time import time
from tests import LimitedTestCase, main, skip_on_windows from tests import LimitedTestCase, main, skip_on_windows, skip_with_pyevent
import re import re
import StringIO import StringIO
@@ -40,6 +40,7 @@ class TestSaranwrap(LimitedTestCase):
self.assertEqual(0, prox.foo) self.assertEqual(0, prox.foo)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_tuple(self): def test_wrap_tuple(self):
my_tuple = (1, 2) my_tuple = (1, 2)
prox = saranwrap.wrap(my_tuple) prox = saranwrap.wrap(my_tuple)
@@ -48,6 +49,7 @@ class TestSaranwrap(LimitedTestCase):
self.assertEqual(len(my_tuple), 2) self.assertEqual(len(my_tuple), 2)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_string(self): def test_wrap_string(self):
my_object = "whatever" my_object = "whatever"
prox = saranwrap.wrap(my_object) prox = saranwrap.wrap(my_object)
@@ -56,6 +58,7 @@ class TestSaranwrap(LimitedTestCase):
self.assertEqual(my_object.join(['a', 'b']), prox.join(['a', 'b'])) self.assertEqual(my_object.join(['a', 'b']), prox.join(['a', 'b']))
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_uniterable(self): def test_wrap_uniterable(self):
# here we're treating the exception as just a normal class # here we're treating the exception as just a normal class
prox = saranwrap.wrap(FloatingPointError()) prox = saranwrap.wrap(FloatingPointError())
@@ -68,6 +71,7 @@ class TestSaranwrap(LimitedTestCase):
self.assertRaises(TypeError, key) self.assertRaises(TypeError, key)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_dict(self): def test_wrap_dict(self):
my_object = {'a':1} my_object = {'a':1}
prox = saranwrap.wrap(my_object) prox = saranwrap.wrap(my_object)
@@ -78,6 +82,7 @@ class TestSaranwrap(LimitedTestCase):
self.assertEqual('saran:' + `my_object`, `prox`) self.assertEqual('saran:' + `my_object`, `prox`)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_module_class(self): def test_wrap_module_class(self):
prox = saranwrap.wrap(re) prox = saranwrap.wrap(re)
self.assertEqual(saranwrap.Proxy, type(prox)) self.assertEqual(saranwrap.Proxy, type(prox))
@@ -86,6 +91,7 @@ class TestSaranwrap(LimitedTestCase):
self.assert_(repr(prox.compile)) self.assert_(repr(prox.compile))
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_eq(self): def test_wrap_eq(self):
prox = saranwrap.wrap(re) prox = saranwrap.wrap(re)
exp1 = prox.compile('.') exp1 = prox.compile('.')
@@ -95,6 +101,7 @@ class TestSaranwrap(LimitedTestCase):
self.assert_(exp1 != exp3) self.assert_(exp1 != exp3)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_nonzero(self): def test_wrap_nonzero(self):
prox = saranwrap.wrap(re) prox = saranwrap.wrap(re)
exp1 = prox.compile('.') exp1 = prox.compile('.')
@@ -103,6 +110,7 @@ class TestSaranwrap(LimitedTestCase):
self.assert_(bool(prox2)) self.assert_(bool(prox2))
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_multiple_wraps(self): def test_multiple_wraps(self):
prox1 = saranwrap.wrap(re) prox1 = saranwrap.wrap(re)
prox2 = saranwrap.wrap(re) prox2 = saranwrap.wrap(re)
@@ -112,6 +120,7 @@ class TestSaranwrap(LimitedTestCase):
x3 = prox2.compile('.') x3 = prox2.compile('.')
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_dict_passthru(self): def test_dict_passthru(self):
prox = saranwrap.wrap(StringIO) prox = saranwrap.wrap(StringIO)
x = prox.StringIO('a') x = prox.StringIO('a')
@@ -120,22 +129,26 @@ class TestSaranwrap(LimitedTestCase):
self.assertEqual(type(saranwrap.wrap(StringIO).StringIO('a').__dict__), saranwrap.ObjectProxy) self.assertEqual(type(saranwrap.wrap(StringIO).StringIO('a').__dict__), saranwrap.ObjectProxy)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_is_value(self): def test_is_value(self):
server = saranwrap.Server(None, None, None) server = saranwrap.Server(None, None, None)
self.assert_(server.is_value(None)) self.assert_(server.is_value(None))
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_getitem(self): def test_wrap_getitem(self):
prox = saranwrap.wrap([0,1,2]) prox = saranwrap.wrap([0,1,2])
self.assertEqual(prox[0], 0) self.assertEqual(prox[0], 0)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_wrap_setitem(self): def test_wrap_setitem(self):
prox = saranwrap.wrap([0,1,2]) prox = saranwrap.wrap([0,1,2])
prox[1] = 2 prox[1] = 2
self.assertEqual(prox[1], 2) self.assertEqual(prox[1], 2)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_raising_exceptions(self): def test_raising_exceptions(self):
prox = saranwrap.wrap(re) prox = saranwrap.wrap(re)
def nofunc(): def nofunc():
@@ -143,6 +156,7 @@ class TestSaranwrap(LimitedTestCase):
self.assertRaises(AttributeError, nofunc) self.assertRaises(AttributeError, nofunc)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_unpicklable_server_exception(self): def test_unpicklable_server_exception(self):
prox = saranwrap.wrap(saranwrap) prox = saranwrap.wrap(saranwrap)
def unpickle(): def unpickle():
@@ -154,6 +168,7 @@ class TestSaranwrap(LimitedTestCase):
#self.assert_server_exists(prox) #self.assert_server_exists(prox)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_pickleable_server_exception(self): def test_pickleable_server_exception(self):
prox = saranwrap.wrap(saranwrap) prox = saranwrap.wrap(saranwrap)
def fperror(): def fperror():
@@ -163,12 +178,14 @@ class TestSaranwrap(LimitedTestCase):
self.assert_server_exists(prox) self.assert_server_exists(prox)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_print_does_not_break_wrapper(self): def test_print_does_not_break_wrapper(self):
prox = saranwrap.wrap(saranwrap) prox = saranwrap.wrap(saranwrap)
prox.print_string('hello') prox.print_string('hello')
self.assert_server_exists(prox) self.assert_server_exists(prox)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_stderr_does_not_break_wrapper(self): def test_stderr_does_not_break_wrapper(self):
prox = saranwrap.wrap(saranwrap) prox = saranwrap.wrap(saranwrap)
prox.err_string('goodbye') prox.err_string('goodbye')
@@ -178,6 +195,7 @@ class TestSaranwrap(LimitedTestCase):
self.assert_(a < b, "%s is not less than %s" % (a, b)) self.assert_(a < b, "%s is not less than %s" % (a, b))
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_status(self): def test_status(self):
prox = saranwrap.wrap(time) prox = saranwrap.wrap(time)
a = prox.gmtime(0) a = prox.gmtime(0)
@@ -197,6 +215,7 @@ class TestSaranwrap(LimitedTestCase):
self.assert_(status['pid'] != saranwrap.status(prox2)['pid']) self.assert_(status['pid'] != saranwrap.status(prox2)['pid'])
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_del(self): def test_del(self):
prox = saranwrap.wrap(time) prox = saranwrap.wrap(time)
delme = prox.gmtime(0) delme = prox.gmtime(0)
@@ -211,12 +230,14 @@ class TestSaranwrap(LimitedTestCase):
self.assertLessThan(status_after['object_count'], status_before['object_count']) self.assertLessThan(status_after['object_count'], status_before['object_count'])
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_contains(self): def test_contains(self):
prox = saranwrap.wrap({'a':'b'}) prox = saranwrap.wrap({'a':'b'})
self.assert_('a' in prox) self.assert_('a' in prox)
self.assert_('x' not in prox) self.assert_('x' not in prox)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_variable_and_keyword_arguments_with_function_calls(self): def test_variable_and_keyword_arguments_with_function_calls(self):
import optparse import optparse
prox = saranwrap.wrap(optparse) prox = saranwrap.wrap(optparse)
@@ -226,6 +247,7 @@ class TestSaranwrap(LimitedTestCase):
self.assertEqual(opts.n, 'foo') self.assertEqual(opts.n, 'foo')
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_original_proxy_going_out_of_scope(self): def test_original_proxy_going_out_of_scope(self):
def make_re(): def make_re():
prox = saranwrap.wrap(re) prox = saranwrap.wrap(re)
@@ -249,6 +271,7 @@ class TestSaranwrap(LimitedTestCase):
pass pass
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_not_inheriting_pythonpath(self): def test_not_inheriting_pythonpath(self):
# construct a fake module in the temp directory # construct a fake module in the temp directory
temp_dir = tempfile.mkdtemp("saranwrap_test") temp_dir = tempfile.mkdtemp("saranwrap_test")
@@ -279,6 +302,7 @@ sys_path = sys.path""")
sys.path.remove(temp_dir) sys.path.remove(temp_dir)
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_contention(self): def test_contention(self):
from tests import saranwrap_test from tests import saranwrap_test
prox = saranwrap.wrap(saranwrap_test) prox = saranwrap.wrap(saranwrap_test)
@@ -290,6 +314,7 @@ sys_path = sys.path""")
pool.waitall() pool.waitall()
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_copy(self): def test_copy(self):
import copy import copy
compound_object = {'a':[1,2,3]} compound_object = {'a':[1,2,3]}
@@ -304,6 +329,7 @@ sys_path = sys.path""")
make_assertions(copy.deepcopy(prox)) make_assertions(copy.deepcopy(prox))
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_list_of_functions(self): def test_list_of_functions(self):
return # this test is known to fail, we can implement it sometime in the future if we wish return # this test is known to fail, we can implement it sometime in the future if we wish
from tests import saranwrap_test from tests import saranwrap_test
@@ -311,6 +337,7 @@ sys_path = sys.path""")
self.assertEquals(list_maker(), prox[0]()) self.assertEquals(list_maker(), prox[0]())
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_under_the_hood_coroutines(self): def test_under_the_hood_coroutines(self):
# so, we want to write a class which uses a coroutine to call # so, we want to write a class which uses a coroutine to call
# a function. Then we want to saranwrap that class, have # a function. Then we want to saranwrap that class, have
@@ -330,6 +357,7 @@ sys_path = sys.path""")
'Coroutine in saranwrapped object did not run') 'Coroutine in saranwrapped object did not run')
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_child_process_death(self): def test_child_process_death(self):
prox = saranwrap.wrap({}) prox = saranwrap.wrap({})
pid = saranwrap.getpid(prox) pid = saranwrap.getpid(prox)
@@ -339,16 +367,19 @@ sys_path = sys.path""")
self.assertRaises(OSError, os.kill, pid, 0) # raises OSError if pid doesn't exist self.assertRaises(OSError, os.kill, pid, 0) # raises OSError if pid doesn't exist
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_detection_of_server_crash(self): def test_detection_of_server_crash(self):
# make the server crash here # make the server crash here
pass pass
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_equality_with_local_object(self): def test_equality_with_local_object(self):
# we'll implement this if there's a use case for it # we'll implement this if there's a use case for it
pass pass
@skip_on_windows @skip_on_windows
@skip_with_pyevent
def test_non_blocking(self): def test_non_blocking(self):
# here we test whether it's nonblocking # here we test whether it's nonblocking
pass pass