summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@monkeypox.org>2009-10-12 23:06:15 -0700
committerR. Tyler Ballance <tyler@monkeypox.org>2009-10-12 23:16:34 -0700
commit989282f984333ccba5ece0256a4268a9726a2d58 (patch)
tree60ff29ba911f659809f68fafb90b6b8100e227cb
parent11a9c395da2dd30547c0129a94562aa94586c6e2 (diff)
downloadpython-cheetah-989282f984333ccba5ece0256a4268a9726a2d58.tar.gz
Update the printing of the Performance tests
I want to print out the directories to ensure that I'm actually testing the code I think I'm testing (*facepalm*)
-rw-r--r--cheetah/Tests/Performance.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cheetah/Tests/Performance.py b/cheetah/Tests/Performance.py
index 213a02b..3dcd8c5 100644
--- a/cheetah/Tests/Performance.py
+++ b/cheetah/Tests/Performance.py
@@ -1,8 +1,5 @@
#!/usr/bin/env python
-import Cheetah.NameMapper
-import Cheetah.Template
-
import hotshot
import hotshot.stats
import os
@@ -12,6 +9,9 @@ import unittest
from test import pystone
import time
+import Cheetah.NameMapper
+import Cheetah.Template
+
# This can be turned on with the `--debug` flag when running the test
# and will cause the tests to all just dump out how long they took
# insteasd of asserting on duration
@@ -86,6 +86,7 @@ class DynamicTemplatePerformanceTest(unittest.TestCase):
class PerformanceTest(unittest.TestCase):
iterations = 100000
display = False
+ save = False
def runTest(self):
self.prof = hotshot.Profile('%s.prof' % self.__class__.__name__)
@@ -100,9 +101,12 @@ class PerformanceTest(unittest.TestCase):
print '>>> %s (%d iterations) ' % (self.__class__.__name__,
self.iterations)
stats = hotshot.stats.load('%s.prof' % self.__class__.__name__)
- stats.strip_dirs()
+ #stats.strip_dirs()
stats.sort_stats('time', 'calls')
- stats.print_stats(40)
+ stats.print_stats(50)
+
+ if not self.save:
+ os.unlink('%s.prof' % self.__class__.__name__)
class DynamicMethodCompilationTest(PerformanceTest):
def performanceSample(self):