Rev 2493: [merge] Marien Zwart: make test_elapsed_time more forgiving. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration
John Arbash Meinel
john at arbash-meinel.com
Thu May 24 17:10:57 BST 2007
At http://bzr.arbash-meinel.com/branches/bzr/jam-integration
------------------------------------------------------------
revno: 2493
revision-id: john at arbash-meinel.com-20070524161045-t2dtfewkpnxeqlnp
parent: pqm at pqm.ubuntu.com-20070524160700-3mu8f24yc5ej88m1
parent: marienz at gentoo.org-20070511003934-5v54sk8ejgxgghst
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Thu 2007-05-24 11:10:45 -0500
message:
[merge] Marien Zwart: make test_elapsed_time more forgiving.
modified:
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 2485.2.1
revision-id: marienz at gentoo.org-20070511003934-5v54sk8ejgxgghst
parent: pqm at pqm.ubuntu.com-20070510055501-w262sk5hl33vmd19
committer: Marien Zwart <marienz at gentoo.org>
branch nick: fix-timed-tests
timestamp: Fri 2007-05-11 02:39:34 +0200
message:
Make test_elapsed_time_with_benchmarking pass on a slow cpu.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2007-04-24 02:43:56 +0000
+++ b/bzrlib/tests/test_selftest.py 2007-05-11 00:39:34 +0000
@@ -620,18 +620,19 @@
result.extractBenchmarkTime(self)
timed_string = result._testTimeString()
# without explicit benchmarking, we should get a simple time.
- self.assertContainsRe(timed_string, "^ *[ 1-9][0-9]ms$")
+ self.assertContainsRe(timed_string, "^ +(0|[1-9][0-9]*)ms$")
# if a benchmark time is given, we want a x of y style result.
self.time(time.sleep, 0.001)
result.extractBenchmarkTime(self)
timed_string = result._testTimeString()
- self.assertContainsRe(timed_string, "^ *[ 1-9][0-9]ms/ *[ 1-9][0-9]ms$")
+ self.assertContainsRe(
+ timed_string, "^ +(0|[1-9][0-9]*)ms/ +(0|[1-9][0-9]*)ms$")
# extracting the time from a non-bzrlib testcase sets to None
result._recordTestStartTime()
result.extractBenchmarkTime(
unittest.FunctionTestCase(self.test_elapsed_time_with_benchmarking))
timed_string = result._testTimeString()
- self.assertContainsRe(timed_string, "^ *[ 1-9][0-9]ms$")
+ self.assertContainsRe(timed_string, "^ +(0|[1-9][0-9]*)ms$")
# cheat. Yes, wash thy mouth out with soap.
self._benchtime = None
More information about the bazaar-commits
mailing list