~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lsprof.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

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
 
 
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()
 
25
from bzrlib.tests import (
 
26
    features,
 
27
    )
39
28
 
40
29
 
41
30
_TXT_HEADER = "   CallCount    Recursive    Total(ms)   " + \
56
45
 
57
46
class TestStatsSave(tests.TestCaseInTempDir):
58
47
 
59
 
    _test_needs_features = [LSProfFeature]
 
48
    _test_needs_features = [features.lsprof_feature]
60
49
 
61
50
    def setUp(self):
62
51
        super(tests.TestCaseInTempDir, self).setUp()
96
85
 
97
86
class TestBzrProfiler(tests.TestCase):
98
87
 
99
 
    _test_needs_features = [LSProfFeature]
 
88
    _test_needs_features = [features.lsprof_feature]
100
89
 
101
90
    def test_start_call_stuff_stop(self):
102
91
        profiler = bzrlib.lsprof.BzrProfiler()