summaryrefslogtreecommitdiff
path: root/Tools/pybench/Exceptions.py
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2006-06-13 18:56:56 +0000
committerMarc-André Lemburg <mal@egenix.com>2006-06-13 18:56:56 +0000
commit7d9743dd6aebe3da1118ed7f0abb7b9cdc6302ff (patch)
tree5fd8c25b53d192efbd69cbd42e6ae4016a215db0 /Tools/pybench/Exceptions.py
parentef7fe5f228292733965c87b99d50a21d64c6d196 (diff)
downloadcpython-git-7d9743dd6aebe3da1118ed7f0abb7b9cdc6302ff.tar.gz
Updated to pybench 2.0.
See svn.python.org/external/pybench-2.0 for the original import of that version. Note that platform.py was not copied over from pybench-2.0 since it is already part of Python 2.5.
Diffstat (limited to 'Tools/pybench/Exceptions.py')
-rw-r--r--Tools/pybench/Exceptions.py30
1 files changed, 25 insertions, 5 deletions
diff --git a/Tools/pybench/Exceptions.py b/Tools/pybench/Exceptions.py
index 7e55708dfe..eff69c717b 100644
--- a/Tools/pybench/Exceptions.py
+++ b/Tools/pybench/Exceptions.py
@@ -2,9 +2,9 @@ from pybench import Test
class TryRaiseExcept(Test):
- version = 0.1
- operations = 2 + 3
- rounds = 60000
+ version = 2.0
+ operations = 2 + 3 + 3
+ rounds = 80000
def test(self):
@@ -31,6 +31,18 @@ class TryRaiseExcept(Test):
raise error,"something"
except:
pass
+ try:
+ raise error("something")
+ except:
+ pass
+ try:
+ raise error("something")
+ except:
+ pass
+ try:
+ raise error("something")
+ except:
+ pass
def calibrate(self):
@@ -42,9 +54,9 @@ class TryRaiseExcept(Test):
class TryExcept(Test):
- version = 0.1
+ version = 2.0
operations = 15 * 10
- rounds = 200000
+ rounds = 150000
def test(self):
@@ -677,3 +689,11 @@ class TryExcept(Test):
for i in xrange(self.rounds):
pass
+
+### Test to make Fredrik happy...
+
+if __name__ == '__main__':
+ import timeit
+ timeit.TestClass = TryRaiseExcept
+ timeit.main(['-s', 'test = TestClass(); test.rounds = 1000',
+ 'test.test()'])