From 3be9c8096d59656e4551a8c2a17a49625397303a Mon Sep 17 00:00:00 2001 From: Nicolas Dumazet <nicolas.dumazet@nexedi.com> Date: Thu, 29 Oct 2009 06:52:19 +0000 Subject: [PATCH] ERP5TypeTestCase.__call__ also needs to be wrapped since r30085 git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30089 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/tests/runUnitTest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/product/ERP5Type/tests/runUnitTest.py b/product/ERP5Type/tests/runUnitTest.py index b6a45e4cba..09f551a8ff 100755 --- a/product/ERP5Type/tests/runUnitTest.py +++ b/product/ERP5Type/tests/runUnitTest.py @@ -330,8 +330,7 @@ def runUnitTestList(test_list, verbosity=1, debug=0): suite = test_loader.loadTestsFromNames(test_list) # Hack the profiler to run only specified test methods, and wrap results when - # running in debug mode. We also monkeypatch unittest.TestCase for tests that - # does not use ERP5TypeTestCase + # running in debug mode. if not dummy_test: test_method_list = os.environ.get('run_only', '').split(',') @@ -349,8 +348,14 @@ def runUnitTestList(test_list, verbosity=1, debug=0): return run_orig(self, result) return run + from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase + ERP5TypeTestCase.__call__ = wrapped_run(ERP5TypeTestCase.__call__) + + # for tests subclassing ZopeTestCase but not ERP5TypeTestCase from Testing.ZopeTestCase import profiler profiler.Profiled.__call__ = wrapped_run(profiler.Profiled.__call__) + + # tests not using ERP5TypeTestCase or ZopeTestCase from unittest import TestCase TestCase.__call__ = wrapped_run(TestCase.__call__) -- 2.30.9