timer_test.py: instead of using add_timer, use schedule_call_global, it is available in all hubs
This commit is contained in:
@@ -56,8 +56,9 @@ class TestTimer(tests.TestCase):
|
|||||||
hub.abort()
|
hub.abort()
|
||||||
api.sleep(0)
|
api.sleep(0)
|
||||||
called = []
|
called = []
|
||||||
t = timer.Timer(0, lambda: (called.append(True), hub.abort()))
|
#t = timer.Timer(0, lambda: (called.append(True), hub.abort()))
|
||||||
t.schedule()
|
#t.schedule()
|
||||||
|
api.get_hub().schedule_call_global(0, lambda: (called.append(True), hub.abort()))
|
||||||
hub.default_sleep = lambda: 0.0
|
hub.default_sleep = lambda: 0.0
|
||||||
hub.run()
|
hub.run()
|
||||||
assert called
|
assert called
|
||||||
|
Reference in New Issue
Block a user