diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-26 19:15:09 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-26 19:15:09 -0400 |
commit | 21cac5b598a83ef0e24423dc523629b475aa3af0 (patch) | |
tree | be4ea137029eabc43caf198852097f03c24f6f53 /test/lib/profiling.py | |
parent | 1a7778632d8039bd687e23522ce6c027e859d487 (diff) | |
download | sqlalchemy-21cac5b598a83ef0e24423dc523629b475aa3af0.tar.gz |
- profile file is configurable
Diffstat (limited to 'test/lib/profiling.py')
-rw-r--r-- | test/lib/profiling.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/lib/profiling.py b/test/lib/profiling.py index dbf969586..ab0bc3f2b 100644 --- a/test/lib/profiling.py +++ b/test/lib/profiling.py @@ -92,12 +92,10 @@ class ProfileStatsFile(object): so no json lib :( need to roll something silly """ - def __init__(self): - from test.bootstrap.config import options - self.write = options is not None and options.write_profiles - dirname, fname = os.path.split(__file__) - self.short_fname = "profiles.txt" - self.fname = os.path.join(dirname, self.short_fname) + def __init__(self, filename): + self.write = config.options is not None and config.options.write_profiles + self.fname = os.path.abspath(filename) + self.short_fname = os.path.split(self.fname)[-1] self.data = collections.defaultdict(lambda: collections.defaultdict(dict)) self._read() if self.write: @@ -206,8 +204,6 @@ class ProfileStatsFile(object): ) profile_f.close() -_profile_stats = ProfileStatsFile() - from sqlalchemy.util.compat import update_wrapper def function_call_count(variance=0.05): |