From: Mike Bayer Date: Thu, 9 Aug 2012 20:43:46 +0000 (-0400) Subject: more adjustments X-Git-Tag: rel_0_8_0b1~273 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e5407239765e10d0fd46e290c1f263af2d12378;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git more adjustments --- diff --git a/test/aaa_profiling/test_pool.py b/test/aaa_profiling/test_pool.py index da4196549c..b55156bf58 100644 --- a/test/aaa_profiling/test_pool.py +++ b/test/aaa_profiling/test_pool.py @@ -32,7 +32,7 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults): # probably # due to the event mechanics being established # or not already... - @profiling.function_call_count(72, variance=.15) + @profiling.function_call_count(55, variance=.15) def test_first_connect(self): conn = pool.connect() @@ -40,7 +40,7 @@ class QueuePoolTest(fixtures.TestBase, AssertsExecutionResults): conn = pool.connect() conn.close() - @profiling.function_call_count(29, variance=.10) + @profiling.function_call_count(17, variance=.10) def go(): conn2 = pool.connect() return conn2 diff --git a/test/aaa_profiling/test_zoomark.py b/test/aaa_profiling/test_zoomark.py index be158613ed..0ecd908e71 100644 --- a/test/aaa_profiling/test_zoomark.py +++ b/test/aaa_profiling/test_zoomark.py @@ -369,15 +369,15 @@ class ZooMarkTest(fixtures.TestBase): def test_profile_1_create_tables(self): self.test_baseline_1_create_tables() - @profiling.function_call_count(4798) + @profiling.function_call_count(4377) def test_profile_1a_populate(self): self.test_baseline_1a_populate() - @profiling.function_call_count(245) + @profiling.function_call_count(218) def test_profile_2_insert(self): self.test_baseline_2_insert() - @profiling.function_call_count(3118) + @profiling.function_call_count(2837) def test_profile_3_properties(self): self.test_baseline_3_properties() @@ -389,7 +389,7 @@ class ZooMarkTest(fixtures.TestBase): def test_profile_5_aggregates(self): self.test_baseline_5_aggregates() - @profiling.function_call_count(1606) + @profiling.function_call_count(1475) def test_profile_6_editing(self): self.test_baseline_6_editing() diff --git a/test/aaa_profiling/test_zoomark_orm.py b/test/aaa_profiling/test_zoomark_orm.py index f5911856e3..942c431a11 100644 --- a/test/aaa_profiling/test_zoomark_orm.py +++ b/test/aaa_profiling/test_zoomark_orm.py @@ -351,8 +351,7 @@ class ZooMarkTest(fixtures.TestBase): def test_profile_4_expressions(self): self.test_baseline_4_expressions() - @profiling.function_call_count(1065, - variance=0.1) + @profiling.function_call_count(900) def test_profile_5_aggregates(self): self.test_baseline_5_aggregates() diff --git a/test/lib/profiling.py b/test/lib/profiling.py index 0c0fe70062..ca93543489 100644 --- a/test/lib/profiling.py +++ b/test/lib/profiling.py @@ -128,11 +128,12 @@ def _paths(key, stats, cache, seen=None): else: seen[key] += 1 try: + path_element = (fname, lineno, fn_name) paths_to_yield = [] (cc, nc, tt, ct, callers) = stats[key] if not callers: - paths_to_yield.append(()) - yield () + paths_to_yield.append((path_element,)) + yield (path_element,) for subkey in callers: sub_cc, sub_nc, sub_tt, sub_ct = callers[subkey] @@ -152,12 +153,27 @@ def _exclude(path): "processors" in pfname or \ "cutils" in pfname: return True + if "threading.py" in pfname: + return True + + if ( + "result.py" in pfname or + "engine/base.py" in pfname + ) and pfuncname in ("__iter__", "__getitem__"): + return True + + if "utf_8.py" in pfname and pfuncname == "decode": + return True + if path[-1][2] in ( "", "" ): return True + if '_thread.RLock' in path[-1][2]: + return True + return False def _count_calls(options, fn, *args, **kw):