Added silent timer support to pyevent hub, upgraded api_test to use actual unit test primitives rather than inventing its own.
This commit is contained in:
@@ -96,6 +96,7 @@ class Hub(BaseHub):
|
||||
self.schedule_call_global(0, api.getcurrent().parent.throw, *self.signal_exc_info)
|
||||
self.signal_exc_info = None
|
||||
else:
|
||||
if not self.silent_timer_exceptions:
|
||||
traceback.print_exc()
|
||||
|
||||
def abort(self):
|
||||
|
@@ -210,12 +210,12 @@ class TestApi(TestCase):
|
||||
state.append('finished')
|
||||
g = api.spawn(test)
|
||||
api.sleep(DELAY/2)
|
||||
assert state == ['start'], state
|
||||
self.assertEquals(state, ['start'])
|
||||
api.kill(g)
|
||||
# will not get there, unless switching is explicitly scheduled by kill
|
||||
assert state == ['start', 'except'], state
|
||||
self.assertEquals(state,['start', 'except'])
|
||||
api.sleep(DELAY)
|
||||
assert state == ['start', 'except', 'finished'], state
|
||||
self.assertEquals(state, ['start', 'except', 'finished'])
|
||||
|
||||
def test_nested_with_timeout(self):
|
||||
def func():
|
||||
|
Reference in New Issue
Block a user