~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Aaron Bentley
  • Date: 2007-06-06 01:05:18 UTC
  • mfrom: (2507 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2510.
  • Revision ID: aaron.bentley@utoronto.ca-20070606010518-kmhq36e8pomuzio7
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
620
620
        result.extractBenchmarkTime(self)
621
621
        timed_string = result._testTimeString()
622
622
        # without explicit benchmarking, we should get a simple time.
623
 
        self.assertContainsRe(timed_string, "^ *[ 1-9][0-9]ms$")
 
623
        self.assertContainsRe(timed_string, "^ +[0-9]+ms$")
624
624
        # if a benchmark time is given, we want a x of y style result.
625
625
        self.time(time.sleep, 0.001)
626
626
        result.extractBenchmarkTime(self)
627
627
        timed_string = result._testTimeString()
628
 
        self.assertContainsRe(timed_string, "^ *[ 1-9][0-9]ms/ *[ 1-9][0-9]ms$")
 
628
        self.assertContainsRe(
 
629
            timed_string, "^ +[0-9]+ms/ +[0-9]+ms$")
629
630
        # extracting the time from a non-bzrlib testcase sets to None
630
631
        result._recordTestStartTime()
631
632
        result.extractBenchmarkTime(
632
633
            unittest.FunctionTestCase(self.test_elapsed_time_with_benchmarking))
633
634
        timed_string = result._testTimeString()
634
 
        self.assertContainsRe(timed_string, "^ *[ 1-9][0-9]ms$")
 
635
        self.assertContainsRe(timed_string, "^ +[0-9]+ms$")
635
636
        # cheat. Yes, wash thy mouth out with soap.
636
637
        self._benchtime = None
637
638