Rev 2533: Improve Feature usage style w/ lsprof in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Jun 18 15:24:46 BST 2007
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 2533
revision-id: pqm at pqm.ubuntu.com-20070618142445-94nnc2l4o1yy6x8l
parent: pqm at pqm.ubuntu.com-20070618052235-mvns8j28szyzscy0
parent: abentley at panoramicfeedback.com-20070618135514-gitkdic3nfyak3ip
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2007-06-18 15:24:45 +0100
message:
Improve Feature usage style w/ lsprof
modified:
bzrlib/tests/test_lsprof.py test_lsprof.py-20070606095601-bctdndm8yhc0cqnc-1
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
------------------------------------------------------------
revno: 1551.2.49.1.40.1.22.1.42.1.31.1.39.1.17.1.28
merged: abentley at panoramicfeedback.com-20070618135514-gitkdic3nfyak3ip
parent: aaron.bentley at utoronto.ca-20070618045658-a2sjuk0r29yx610c
committer: Aaron Bentley <abentley at panoramicfeedback.com>
branch nick: Aaron's mergeable stuff
timestamp: Mon 2007-06-18 09:55:14 -0400
message:
Improve Feature usage style w/ lsprof
=== modified file 'bzrlib/tests/test_lsprof.py'
--- a/bzrlib/tests/test_lsprof.py 2007-06-13 05:43:25 +0000
+++ b/bzrlib/tests/test_lsprof.py 2007-06-18 13:55:14 +0000
@@ -24,7 +24,7 @@
from bzrlib import tests
-class LSProf(tests.Feature):
+class _LSProfFeature(tests.Feature):
def available(self):
try:
@@ -35,6 +35,9 @@
return True
+LSProfFeature = _LSProfFeature()
+
+
_TXT_HEADER = " CallCount Recursive Total(ms) " + \
"Inline(ms) module:lineno(function)\n"
@@ -53,8 +56,9 @@
class TestStatsSave(tests.TestCaseInTempDir):
+ _test_needs_features = [LSProfFeature]
+
def setUp(self):
- self.requireFeature(LSProf())
super(tests.TestCaseInTempDir, self).setUp()
self.stats = _collect_stats()
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2007-06-15 07:01:24 +0000
+++ b/bzrlib/tests/test_selftest.py 2007-06-18 13:55:14 +0000
@@ -681,7 +681,7 @@
def test_lsprofiling(self):
"""Verbose test result prints lsprof statistics from test cases."""
- self.requireFeature(test_lsprof.LSProf())
+ self.requireFeature(test_lsprof.LSProfFeature)
result_stream = StringIO()
result = bzrlib.tests.VerboseTestResult(
unittest._WritelnDecorator(result_stream),
@@ -1193,7 +1193,7 @@
Each self.time() call is individually and separately profiled.
"""
- self.requireFeature(test_lsprof.LSProf())
+ self.requireFeature(test_lsprof.LSProfFeature)
# overrides the class member with an instance member so no cleanup
# needed.
self._gather_lsprof_in_benchmarks = True
More information about the bazaar-commits
mailing list