Commit f8e53d76 authored by Denis Bilenko's avatar Denis Bilenko

add a new test for Event

parent 0d4ed82c
......@@ -77,6 +77,26 @@ class TestAsync_ResultAsLinkTarget(greentest.TestCase):
assert gevent.with_timeout(DELAY, s2.get, timeout_value=X) is X
self.assertRaises(ZeroDivisionError, s3.get)
class TestEvent_SetThenClear(greentest.TestCase):
N = 1
def test(self):
e = Event()
waiters = [gevent.spawn(e.wait) for i in xrange(self.N)]
gevent.sleep(0.001)
e.set()
e.clear()
for t in waiters:
t.join()
class TestEvent_SetThenClear100(TestEvent_SetThenClear):
N = 100
class TestEvent_SetThenClear1000(TestEvent_SetThenClear):
N = 1000
X = object()
if __name__=='__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment