summaryrefslogtreecommitdiffstats
path: root/Tools/pybench/Exceptions.py
diff options
context:
space:
mode:
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 7e55708..eff69c7 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()'])