summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-08-28 10:19:11 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-08-28 10:19:11 -0400
commit03c9b2df770385fc3b2b0acbdcb809c2239b67ef (patch)
treefb291bc1283776bdd26bc5d6f8a18ad8ef0e0bcf
parent835f1a38bf44c65739b5b8831258006187b76963 (diff)
downloadsqlalchemy-03c9b2df770385fc3b2b0acbdcb809c2239b67ef.tar.gz
- fix bug here in profiling.py
- callcount
-rw-r--r--lib/sqlalchemy/testing/profiling.py22
-rw-r--r--test/profiles.txt2
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/sqlalchemy/testing/profiling.py b/lib/sqlalchemy/testing/profiling.py
index 2e0a5babc..4f6ea3f90 100644
--- a/lib/sqlalchemy/testing/profiling.py
+++ b/lib/sqlalchemy/testing/profiling.py
@@ -274,17 +274,17 @@ def function_call_count(variance=0.05):
deviance = int(callcount * variance)
failed = abs(callcount - expected_count) > deviance
- if failed:
- if _profile_stats.write:
- _profile_stats.replace(callcount)
- else:
- raise AssertionError(
- "Adjusted function call count %s not within %s%% "
- "of expected %s. Rerun with --write-profiles to "
- "regenerate this callcount."
- % (
- callcount, (variance * 100),
- expected_count))
+ if failed:
+ if _profile_stats.write:
+ _profile_stats.replace(callcount)
+ else:
+ raise AssertionError(
+ "Adjusted function call count %s not within %s%% "
+ "of expected %s. Rerun with --write-profiles to "
+ "regenerate this callcount."
+ % (
+ callcount, (variance * 100),
+ expected_count))
return fn_result
return update_wrapper(wrap, fn)
return decorate
diff --git a/test/profiles.txt b/test/profiles.txt
index fc13bedc1..9b6cf5aa5 100644
--- a/test/profiles.txt
+++ b/test/profiles.txt
@@ -391,7 +391,7 @@ test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_5_aggregates 3.3_postgr
# TEST: test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing
-test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing 2.7_postgresql_psycopg2_cextensions 1811
+test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing 2.7_postgresql_psycopg2_cextensions 1905
test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing 2.7_postgresql_psycopg2_nocextensions 1858
test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing 3.2_postgresql_psycopg2_nocextensions 1731
test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing 3.3_postgresql_psycopg2_cextensions 1846