allow testPerformance to run (sans profiling) on Python 2.4

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44608 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d1684e8b
......@@ -36,7 +36,6 @@ from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zLOG import LOG
from Products.ERP5Type.tests.utils import LogInterceptor
from cProfile import Profile
import os
# Define variable to chek if performance are good or not
......@@ -203,6 +202,7 @@ class TestPerformance(ERP5TypeTestCase, LogInterceptor):
'%.4f < %.4f < %.4f' % (min, req_time, max))
def profile(self, func, suffix=''):
from cProfile import Profile
prof_file = '%s%s' % (func.__name__, suffix)
try:
os.unlink(prof_file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment