Example #1
0
 def test_debug_print(self):
     from __pypy__ import debug_start, debug_stop, debug_print
     debug_start('my-category')
     debug_print('one')
     debug_print('two', 3, [])
     debug_stop('my-category')
     self.check_log([('my-category', [
         ('debug_print', 'one'),
         ('debug_print', 'two 3 []'),
     ])])
Example #2
0
 def test_debug_start_stop_timestamp(self):
     import time
     from __pypy__ import debug_start, debug_stop, debug_read_timestamp
     assert debug_start('foo') is None
     assert debug_stop('foo') is None
     ts1 = debug_start('foo', timestamp=True)
     t = time.clock()
     while time.clock() - t < 0.02:
         pass
     ts2 = debug_stop('foo', timestamp=True)
     assert ts2 > ts1
Example #3
0
 def test_debug_print(self):
     from __pypy__ import debug_start, debug_stop, debug_print
     debug_start('my-category')
     debug_print('one')
     debug_print('two', 3, [])
     debug_stop('my-category')
     self.check_log([
             ('my-category', [
                     ('debug_print', 'one'),
                     ('debug_print', 'two 3 []'),
                     ])
             ])