コード例 #1
0
ファイル: profileTests.py プロジェクト: vinzenz/vdsm
 def test_with_builtins(self):
     requires_yappi()
     profile.start()
     dict()
     profile.stop()
     stats = open_ystats(FILENAME)
     self.assertTrue(find_module(stats, '__builtin__'))
コード例 #2
0
ファイル: profileTests.py プロジェクト: vinzenz/vdsm
 def test_fail_if_Profile_is_running(self):
     requires_yappi()
     profile.start()
     try:
         self.assertRaises(profile.Error, self.profiled_function)
     finally:
         profile.stop()
コード例 #3
0
ファイル: profileTests.py プロジェクト: aiminickwong/vdsm
 def test_with_builtins(self):
     requires_yappi()
     profile.start()
     dict()
     profile.stop()
     stats = open_ystats(FILENAME)
     self.assertTrue(find_module(stats, '__builtin__'))
コード例 #4
0
ファイル: profileTests.py プロジェクト: aiminickwong/vdsm
 def test_fail_if_Profile_is_running(self):
     requires_yappi()
     profile.start()
     try:
         self.assertRaises(profile.Error, self.profiled_function)
     finally:
         profile.stop()
コード例 #5
0
 def test_ystats_format(self):
     requires_yappi()
     profile.start()
     profile.is_running()  # Let if profile something
     profile.stop()
     stats = yappi.YFuncStats()
     stats.add(FILENAME)
コード例 #6
0
ファイル: profileTests.py プロジェクト: vinzenz/vdsm
 def test_is_running(self):
     requires_yappi()
     self.assertFalse(profile.is_running())
     profile.start()
     try:
         self.assertTrue(profile.is_running())
     finally:
         profile.stop()
     self.assertFalse(profile.is_running())
コード例 #7
0
ファイル: profileTests.py プロジェクト: vinzenz/vdsm
 def test_wall_clock(self):
     requires_yappi()
     profile.start()
     self.sleep(0.1)
     profile.stop()
     stats = open_ystats(FILENAME)
     name = function_name(self.sleep)
     func = find_function(stats, __file__, name)
     self.assertTrue(func.ttot > 0.1)
コード例 #8
0
ファイル: profileTests.py プロジェクト: aiminickwong/vdsm
 def test_is_running(self):
     requires_yappi()
     self.assertFalse(profile.is_running())
     profile.start()
     try:
         self.assertTrue(profile.is_running())
     finally:
         profile.stop()
     self.assertFalse(profile.is_running())
コード例 #9
0
ファイル: profileTests.py プロジェクト: aiminickwong/vdsm
 def test_wall_clock(self):
     requires_yappi()
     profile.start()
     self.sleep(0.1)
     profile.stop()
     stats = open_ystats(FILENAME)
     name = function_name(self.sleep)
     func = find_function(stats, __file__, name)
     self.assertTrue(func.ttot > 0.1)
コード例 #10
0
ファイル: profileTests.py プロジェクト: vinzenz/vdsm
 def test_ystats_format(self):
     requires_yappi()
     profile.start()
     profile.is_running()  # Let if profile something
     profile.stop()
     self.assertNotRaises(open_ystats, FILENAME)
コード例 #11
0
ファイル: profileTests.py プロジェクト: vinzenz/vdsm
 def test_disabled(self):
     profile.start()
     try:
         self.assertFalse(profile.is_running())
     finally:
         profile.stop()
コード例 #12
0
ファイル: profileTests.py プロジェクト: aiminickwong/vdsm
 def test_ystats_format(self):
     requires_yappi()
     profile.start()
     profile.is_running()  # Let if profile something
     profile.stop()
     self.assertNotRaises(open_ystats, FILENAME)
コード例 #13
0
ファイル: profileTests.py プロジェクト: aiminickwong/vdsm
 def test_disabled(self):
     profile.start()
     try:
         self.assertFalse(profile.is_running())
     finally:
         profile.stop()
コード例 #14
0
 def test_pstats_format(self):
     requires_yappi()
     profile.start()
     profile.is_running()  # Let if profile something
     profile.stop()
     pstats.Stats(FILENAME)