diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-10-27 17:41:30 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-10-27 17:41:30 +0000 |
| commit | 4a4daad81a6c5f987ac6eba0afdaccb3a70554f8 (patch) | |
| tree | c5d4286d3b318774a518f31a31a66e99286c0a1e /test/testlib | |
| parent | cba1e9a01ef292a5bb7fdd4e0c62f4f7509f38b9 (diff) | |
| download | sqlalchemy-4a4daad81a6c5f987ac6eba0afdaccb3a70554f8.tar.gz | |
- removed regular expression step from most statement compilations.
also fixes [ticket:833]
- inlining on PG with_returning() call
- extra options added for profiling
Diffstat (limited to 'test/testlib')
| -rw-r--r-- | test/testlib/profiling.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/testlib/profiling.py b/test/testlib/profiling.py index f2f75f66e..947bf962e 100644 --- a/test/testlib/profiling.py +++ b/test/testlib/profiling.py @@ -13,7 +13,7 @@ profile_config = { 'targets': set(), 'sort': ('time', 'calls'), 'limit': None } -def profiled(target, **target_opts): +def profiled(target=None, **target_opts): """Optional function profiling. @profiled('label') @@ -28,7 +28,9 @@ def profiled(target, **target_opts): import time, hotshot, hotshot.stats # manual or automatic namespacing by module would remove conflict issues - if target in all_targets: + if target is None: + target = 'anonymous_target' + elif target in all_targets: print "Warning: redefining profile target '%s'" % target all_targets.add(target) @@ -70,6 +72,8 @@ def profiled(target, **target_opts): assert_range = target_opts.get('call_range') if assert_range: + if isinstance(assert_range, dict): + assert_range = assert_range.get(testlib.config.db, 'default') stats = hotshot.stats.load(filename) assert stats.total_calls >= assert_range[0] and stats.total_calls <= assert_range[1], stats.total_calls |
