summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_hotshot.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_hotshot.py')
-rw-r--r--Lib/test/test_hotshot.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_hotshot.py b/Lib/test/test_hotshot.py
index fa6b2f1..bc499bb 100644
--- a/Lib/test/test_hotshot.py
+++ b/Lib/test/test_hotshot.py
@@ -10,6 +10,7 @@ import gc
from test import test_support
from hotshot.log import ENTER, EXIT, LINE
+from hotshot import stats
def shortfilename(fn):
@@ -136,6 +137,19 @@ class HotShotTestCase(unittest.TestCase):
emptyfile.close()
gc.collect()
+ def test_load_stats(self):
+ def start(prof):
+ prof.start()
+ # Make sure stats can be loaded when start and stop of profiler
+ # are not executed in the same stack frame.
+ profiler = self.new_profiler()
+ start(profiler)
+ profiler.stop()
+ profiler.close()
+ stats.load(self.logfn)
+ os.unlink(self.logfn)
+
+
def test_main():
test_support.run_unittest(HotShotTestCase)