def test_dispatch_priority(self, dispatcher, loop, evt):
        called = list()

        @event.event(evt.name, priority=0)
        async def corofunc():
            called.append(corofunc)

        @event.event(evt.name, priority=1)
        def corofunc2():
            called.append(corofunc2)

        h_inst = event.HandlerInstance.from_handler(corofunc)
        h_inst2 = event.HandlerInstance.from_handler(corofunc2)
        dispatcher.register(h_inst)
        dispatcher.register(h_inst2)
        loop.run_until_complete(dispatcher.dispatch(evt))

        assert called == [corofunc2, corofunc]