Hook into any test lifecycle event with a simple API
from vedro.core import Dispatcher, Plugin
from vedro.events import CleanupEvent
class SlackNotifierPlugin(Plugin):
def subscribe(self, dispatcher: Dispatcher):
dispatcher.listen(CleanupEvent, self.on_cleanup)
def on_cleanup(self, event: CleanupEvent):
if event.report.failed > 0:
notify_slack(f"❌ {event.report.failed} tests failed!")