[svn r86] Quieted noisy tests.

This commit is contained in:
which.linden
2008-02-04 20:39:10 -05:00
parent f18cc0367e
commit da2063fef6
2 changed files with 16 additions and 4 deletions

View File

@@ -28,6 +28,11 @@ from eventlet import httpd
from eventlet import processes
from eventlet import util
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
util.wrap_socket_with_coroutine_socket()
@@ -79,8 +84,9 @@ def read_http(sock):
class TestHttpd(tests.TestCase):
mode = 'static'
def setUp(self):
self.logfile = StringIO()
self.killer = api.spawn(
httpd.server, api.tcp_listener(('0.0.0.0', 12346)), Site(), max_size=128)
httpd.server, api.tcp_listener(('0.0.0.0', 12346)), Site(), max_size=128, log=self.logfile)
def tearDown(self):
api.kill(self.killer)

View File

@@ -26,13 +26,19 @@ from sys import stdout
import random
r = random.WichmannHill()
_g_debug = False
def prnt(msg):
if _g_debug:
print msg
class yadda(object):
def __init__(self):
pass
def foo(self,when,n=None):
assert(n is not None)
print "foo: %s, %s" % (when,n)
prnt("foo: %s, %s" % (when,n))
time.sleep(r.random())
return n
@@ -42,9 +48,9 @@ def sender_loop(pfx):
while n < 10:
api.sleep(0)
now = time.time()
print "%s: send (%s,%s)" % (pfx,now,n)
prnt("%s: send (%s,%s)" % (pfx,now,n))
rv = obj.foo(now,n=n)
print "%s: recv %s" % (pfx, rv)
prnt("%s: recv %s" % (pfx, rv))
assert(n == rv)
api.sleep(0)
n += 1