예제 #1
0
파일: test_engine.py 프로젝트: ynuosoft/cr8
 def test_fail_if_supports_runtime_stats(self):
     stats = Stats()
     stats.measure(103.2)
     stats.measure(205.2)
     timed_stats = TimedStats(1, 2, stats)
     result = Result({}, 'select name', timed_stats, 1)
     with self.assertRaises(FailIf):
         eval_fail_if("{runtime_stats.max} > 30", result)
예제 #2
0
파일: test_log.py 프로젝트: chaudum/cr8
 def test_short_result_output_with_only_1_measurement(self):
     stats = Stats(1)
     stats.measure(23.4)
     self.assertEqual(
         format_stats(stats.get(), 'short'),
         ('Runtime (in ms):\n'
          '    mean:    23.400 ± 0.000')
     )
예제 #3
0
파일: test_log.py 프로젝트: ynuosoft/cr8
 def test_short_result_output_with_only_1_measurement(self):
     stats = Stats()
     stats.measure(23.4)
     self.assertEqual(
         format_stats(stats.get(), 'short'),
         ('Runtime (in ms):\n'
          '    mean:    23.400 ± 0.000')
     )
예제 #4
0
 def test_short_result_output_with_more_measurements(self):
     stats = Stats(4)
     stats.measure(23.4)
     stats.measure(48.7)
     stats.measure(32.5)
     stats.measure(15.9)
     self.assertEqual(format_stats(stats.get(), 'short'),
                      ('Runtime (in ms):\n'
                       '    mean:    30.125 ± 13.839\n'
                       '    min/max: 15.900 → 48.700\n'
                       'Percentile:\n'
                       '    50:   23.400 ± 14.121 (stdev)\n'
                       '    95:   48.700\n'
                       '    99.9: 48.700'))
예제 #5
0
파일: test_log.py 프로젝트: chaudum/cr8
 def test_short_result_output_with_more_measurements(self):
     stats = Stats(4)
     stats.measure(23.4)
     stats.measure(48.7)
     stats.measure(32.5)
     stats.measure(15.9)
     self.assertEqual(
         format_stats(stats.get(), 'short'),
         ('Runtime (in ms):\n'
          '    mean:    30.125 ± 13.839\n'
          '    min/max: 15.900 → 48.700\n'
          'Percentile:\n'
          '    50:   23.400 ± 14.121 (stdev)\n'
          '    95:   48.700\n'
          '    99.9: 48.700')
     )