def test_reset_all_hooks(): register_hook('execute.task-executed1', inc_A) jug_hook('execute.task-executed1') assert len(A) == 1 reset_all_hooks() jug_hook('execute.task-executed1') assert len(A) == 1
def task_reset_at_exit(): jug.task.Task.store = dict_store() while jug.task.alltasks: jug.task.alltasks.pop() yield jug.task.Task.store = None while jug.task.alltasks: jug.task.alltasks.pop() reset_all_hooks()
def _teardown(): jug.task.Task.store = None while jug.task.alltasks: jug.task.alltasks.pop() reset_all_hooks()
def teardown(): reset_all_hooks() del A[:] # A.clear() is not available in Python 2.x