diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-10 11:10:21 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-10 11:10:21 -0400 |
commit | 2f522bd2217ca3421a912413f66b42dcec164df3 (patch) | |
tree | 3e7da852e443386d6bafcf52dd67b6dab3dcc287 /test/lib/profiling.py | |
parent | 153248cf7b74e7dfcd29e093aea51657e74148fc (diff) | |
download | sqlalchemy-2f522bd2217ca3421a912413f66b42dcec164df3.tar.gz |
final cleanup
Diffstat (limited to 'test/lib/profiling.py')
-rw-r--r-- | test/lib/profiling.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/lib/profiling.py b/test/lib/profiling.py index ca9354348..7f73c5829 100644 --- a/test/lib/profiling.py +++ b/test/lib/profiling.py @@ -79,8 +79,20 @@ def profiled(target=None, **target_opts): return result return decorate -def function_call_count(count=None, versions={}, variance=0.05): - """Assert a target for a test case's function call count.""" +def function_call_count(count=None, variance=0.05): + """Assert a target for a test case's function call count. + + The main purpose of this assertion is to detect changes in + callcounts for various functions - the actual number is not as important. + Therefore, to help with cross-compatibility between Python interpreter + platforms/versions + as well as whether or not C extensions are in use, the call count is + "adjusted" to account for various functions that don't appear in all + environments. This introduces the small possibility for a significant change + in callcount to be missed, in the case that the callcount is local + to that set of skipped functions. + + """ py_version = '.'.join([str(v) for v in sys.version_info]) @@ -159,7 +171,7 @@ def _exclude(path): if ( "result.py" in pfname or "engine/base.py" in pfname - ) and pfuncname in ("__iter__", "__getitem__"): + ) and pfuncname in ("__iter__", "__getitem__", "__len__", "__init__"): return True if "utf_8.py" in pfname and pfuncname == "decode": |