~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lsprof.py

(gz) Fix test failure on alpha by correcting format string for
 gc_chk_sha1_record (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import bzrlib
24
24
from bzrlib import errors, tests
25
 
from bzrlib.tests import (
26
 
    features,
27
 
    )
 
25
 
 
26
 
 
27
class _LSProfFeature(tests.Feature):
 
28
 
 
29
    def available(self):
 
30
        try:
 
31
            from bzrlib import lsprof
 
32
        except ImportError:
 
33
            return False
 
34
        else:
 
35
            return True
 
36
 
 
37
 
 
38
LSProfFeature = _LSProfFeature()
28
39
 
29
40
 
30
41
_TXT_HEADER = "   CallCount    Recursive    Total(ms)   " + \
45
56
 
46
57
class TestStatsSave(tests.TestCaseInTempDir):
47
58
 
48
 
    _test_needs_features = [features.lsprof_feature]
 
59
    _test_needs_features = [LSProfFeature]
49
60
 
50
61
    def setUp(self):
51
62
        super(tests.TestCaseInTempDir, self).setUp()
85
96
 
86
97
class TestBzrProfiler(tests.TestCase):
87
98
 
88
 
    _test_needs_features = [features.lsprof_feature]
 
99
    _test_needs_features = [LSProfFeature]
89
100
 
90
101
    def test_start_call_stuff_stop(self):
91
102
        profiler = bzrlib.lsprof.BzrProfiler()