# HG changeset patch # User Laurent Peuch # Date 1556004832 -7200 # Node ID 4f59a56e6d89c5a3db8e6345f830805fd64c3b73 # Parent 2b0a3f2607f0a3daa7d8cd93772783431caf58f0 [enh] don't catch all exceptions in notification hooks during tests diff -r 2b0a3f2607f0 -r 4f59a56e6d89 cubicweb/hooks/notification.py --- a/cubicweb/hooks/notification.py Thu Apr 18 15:09:36 2019 +0200 +++ b/cubicweb/hooks/notification.py Tue Apr 23 09:33:52 2019 +0200 @@ -70,6 +70,12 @@ # to prevent them all. self.exception('Notification failed') + if self.cnx.vreg.config.mode == "test": + # reraise in testing context because we actually want to + # have those exceptions here and that self.exception is + # filtered in test context + raise + class NotificationHook(hook.Hook): __abstract__ = True diff -r 2b0a3f2607f0 -r 4f59a56e6d89 doc/changes/3.27.rst --- a/doc/changes/3.27.rst Thu Apr 18 15:09:36 2019 +0200 +++ b/doc/changes/3.27.rst Tue Apr 23 09:33:52 2019 +0200 @@ -27,6 +27,10 @@ * Python 2 support has been dropped. +* Exceptions in notification hooks aren't catched-all anymore during tests so + one can expect tests that seem to pass (but were actually silently failing) + to fail now. + Deprecated code drops ---------------------