[IMP] tests: improve logging of active patcher

Part-of: odoo/odoo#137215
This commit is contained in:
Xavier-Do
2023-10-03 07:19:00 +00:00
parent 22f31a5d0c
commit b67f50a57a
+1 -1
View File
@@ -303,7 +303,7 @@ class BaseCase(case.TestCase, metaclass=MetaCase):
def setUpClass(cls):
def check_remaining_patchers():
for patcher in _patch._active_patches:
_logger.warning("A patcher was remaining active at the end of %s, disabling it...", cls.__name__)
_logger.warning("A patcher (targeting %s.%s) was remaining active at the end of %s, disabling it...", patcher.target, patcher.attribute, cls.__name__)
patcher.stop()
cls.addClassCleanup(check_remaining_patchers)
super().setUpClass()