Changeset 391 for python/trunk/Lib/test/test_hotshot.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/test/test_hotshot.py
r2 r391 1 import hotshot2 import hotshot.log3 1 import os 4 2 import pprint … … 10 8 from test import test_support 11 9 10 # Silence Py3k warning 11 hotshot = test_support.import_module('hotshot', deprecated=True) 12 12 from hotshot.log import ENTER, EXIT, LINE 13 from hotshot import stats 13 14 14 15 … … 65 66 if profiler is None: 66 67 profiler = self.new_profiler() 67 self. failUnless(not profiler._prof.closed)68 self.assertTrue(not profiler._prof.closed) 68 69 profiler.runcall(callable) 69 self. failUnless(not profiler._prof.closed)70 self.assertTrue(not profiler._prof.closed) 70 71 profiler.close() 71 self. failUnless(profiler._prof.closed)72 self.assertTrue(profiler._prof.closed) 72 73 self.check_events(events) 73 74 … … 81 82 info = log._info 82 83 list(log) 83 self. failUnless(info["test-key"] == ["test-value"])84 self.assertTrue(info["test-key"] == ["test-value"]) 84 85 85 86 def test_line_numbers(self): … … 137 138 gc.collect() 138 139 140 def test_load_stats(self): 141 def start(prof): 142 prof.start() 143 # Make sure stats can be loaded when start and stop of profiler 144 # are not executed in the same stack frame. 145 profiler = self.new_profiler() 146 start(profiler) 147 profiler.stop() 148 profiler.close() 149 stats.load(self.logfn) 150 os.unlink(self.logfn) 151 152 139 153 def test_main(): 140 154 test_support.run_unittest(HotShotTestCase)
Note:
See TracChangeset
for help on using the changeset viewer.