def test_hotshot_function_is_twenty(self): prof = p2h.Converter(twenty_hotprof_testdata_path) prof.printout('html', self.dirname) path = self.dirname + '/index.html' self.assertEqual(True, os.path.exists(path)) path = self.dirname + '/index-all.html' self.assertEqual(False, os.path.exists(path))
import pyprof2html # run profiling.py first # this creates files in the stats directory converter = pyprof2html.Converter("stats/profilestats.out") converter._hookhtml() # display html/index.html in web browser import webbrowser, os url = os.getcwd().replace('\\', '/') # getcwd() returns slashes the wrong way round for a browser url = "file:///" + url + "/html/index.html" print(url) webbrowser.open_new(url) 1
def test_hotshotlinehtml(self): prof = p2h.Converter(hotshotline_testdata_path) prof.output_dir = self.dirname prof.printout('html') self.assertEqual(True, True)
def test_hotshothtml(self): prof = p2h.Converter(hotshot_testdata_path) prof.printout('html', self.dirname) self.assertEqual(True, os.path.exists(self.dirname + '/index.html'))
def test_profilehtml(self): prof = p2h.Converter(prof_testdata_path) prof.output_dir = self.dirname prof.printout('html', self.dirname) self.assertEqual(True, os.path.exists(self.dirname + '/index.html'))
def test_hotshotraw(self): prof = p2h.Converter(hotshot_testdata_path) prof.printout('raw') self.assertEqual(True, True)
def test_cprofraw(self): prof = p2h.Converter(cprof_testdata_path) prof.printout('raw') self.assertEqual(True, True)