

def test_deregister_non_existent_listener(self):
    handler1 = (lambda event_type, details: None)
    handler2 = (lambda event_type, details: None)
    a_task = MyTask()
    a_task.notifier.register(task.EVENT_UPDATE_PROGRESS, handler1)
    self.assertEqual(1, len(list(a_task.notifier.listeners_iter())))
    a_task.notifier.deregister(task.EVENT_UPDATE_PROGRESS, handler1)
    self.assertEqual(1, len(list(a_task.notifier.listeners_iter())))
    a_task.notifier.deregister(task.EVENT_UPDATE_PROGRESS, handler1)
    self.assertEqual(0, len(list(a_task.notifier.listeners_iter())))

dataset/ETHPy150Open openstack/taskflow/taskflow/tests/unit/test_task.py TaskTest.test_deregister_non_existent_listener/VarMisuse@82/117 `handler2`->`handler1`