diff options
author | Fred Drake <fdrake@acm.org> | 2001-10-29 20:54:01 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-10-29 20:54:01 (GMT) |
commit | f3c54d6fc7b59cbb28c0a74171cd18ae453461bb (patch) | |
tree | 8ed8769cea347e3b8b6b8428272c59972a07bda2 | |
parent | 165b2cc2bdf17b1cb4b695f2438e611313d99c1c (diff) | |
download | cpython-f3c54d6fc7b59cbb28c0a74171cd18ae453461bb.zip cpython-f3c54d6fc7b59cbb28c0a74171cd18ae453461bb.tar.gz cpython-f3c54d6fc7b59cbb28c0a74171cd18ae453461bb.tar.bz2 |
Add a test for the insertion of user-provided ADD_INFO records.
-rw-r--r-- | Lib/test/test_hotshot.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_hotshot.py b/Lib/test/test_hotshot.py index 7188f1b..938687e 100644 --- a/Lib/test/test_hotshot.py +++ b/Lib/test/test_hotshot.py @@ -41,8 +41,7 @@ class HotShotTestCase(unittest.TestCase): return hotshot.Profile(self.logfn, lineevents, linetimings) def get_logreader(self): - log = UnlinkingLogReader(self.logfn) - return log + return UnlinkingLogReader(self.logfn) def get_events_wotime(self): L = [] @@ -68,6 +67,17 @@ class HotShotTestCase(unittest.TestCase): profiler.close() self.check_events(events) + def test_addinfo(self): + def f(p): + p.addinfo("test-key", "test-value") + profiler = self.new_profiler() + profiler.runcall(f, profiler) + profiler.close() + log = self.get_logreader() + info = log._info + list(log) + self.failUnless(info["test-key"] == ["test-value"]) + def test_line_numbers(self): def f(): y = 2 |