summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/profiling.py
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 /lib/sqlalchemy/testing/profiling.py
parent835f1a38bf44c65739b5b8831258006187b76963 (diff)
downloadsqlalchemy-03c9b2df770385fc3b2b0acbdcb809c2239b67ef.tar.gz
- fix bug here in profiling.py
- callcount
Diffstat (limited to 'lib/sqlalchemy/testing/profiling.py')
-rw-r--r--lib/sqlalchemy/testing/profiling.py22
1 files changed, 11 insertions, 11 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