Skip to content

Commit

Permalink
whitespace fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
strichter committed Jul 22, 2009
1 parent f967ce0 commit 384389b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions benchmark/benchmark/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
def benchmark(title):
def decorator(f):
def wrapper(*args):
print "===============================\n %s\n===============================" % title
print "==============================="
print title
print "==============================="
return f(*args)
return wrapper
return decorator
Expand Down Expand Up @@ -73,7 +75,7 @@ def build_many_fields(size):
__name__=name,
description=u"This field renders %s" % name,
title=u"Title of %s" % name.capitalize())

IManyFields = tuple(build_many_fields(500))

class BaseTestCase(unittest.TestCase):
Expand All @@ -89,16 +91,17 @@ def _tearDown(suite):
class BenchmarkTestCase(BaseTestCase):
def simple_form(self, cls, iface):
class SimpleForm(form.AddForm):
fields = field.Fields(*(isinstance(iface, tuple) and iface or (iface,)))
fields = field.Fields(
*(isinstance(iface, tuple) and iface or (iface,)))
render = cls(
os.path.join(tests.__path__[0], 'simple_edit.pt'))
return SimpleForm

@benchmark(u"Small add-form (update/render)")
def testSmallForm(self):
context = object()
request = testing.TestRequest()

f_z3c = self.simple_form(
z3cViewPageTemplateFile, ISmallForm)(context, request)
f_zope = self.simple_form(
Expand All @@ -117,7 +120,7 @@ def testSmallForm(self):
def testLargeDataSets(self):
context = object()
request = testing.TestRequest()

f_z3c = self.simple_form(
z3cViewPageTemplateFile, ILargeDataSetsForm)(context, request)
f_zope = self.simple_form(
Expand All @@ -136,7 +139,7 @@ def testLargeDataSets(self):
def testManyFields(self):
context = object()
request = testing.TestRequest()

f_z3c = self.simple_form(
z3cViewPageTemplateFile, IManyFields)(context, request)
f_zope = self.simple_form(
Expand All @@ -158,7 +161,7 @@ def benchmark(self, prep, func, *args):
t = timing(func, *args)
self._tearDown()
return t

def test_suite():
return unittest.TestSuite((
unittest.makeSuite(BenchmarkTestCase),
Expand Down

0 comments on commit 384389b

Please sign in to comment.