~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lsprof.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2007, 2009, 2010, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
18
18
 
19
19
 
20
20
import cPickle
21
 
import os
22
21
import threading
23
22
 
24
23
import bzrlib
25
24
from bzrlib import errors, tests
26
 
 
27
 
 
28
 
class _LSProfFeature(tests.Feature):
29
 
 
30
 
    def available(self):
31
 
        try:
32
 
            from bzrlib import lsprof
33
 
        except ImportError:
34
 
            return False
35
 
        else:
36
 
            return True
37
 
 
38
 
 
39
 
LSProfFeature = _LSProfFeature()
 
25
from bzrlib.tests import (
 
26
    features,
 
27
    )
40
28
 
41
29
 
42
30
_TXT_HEADER = "   CallCount    Recursive    Total(ms)   " + \
57
45
 
58
46
class TestStatsSave(tests.TestCaseInTempDir):
59
47
 
60
 
    _test_needs_features = [LSProfFeature]
 
48
    _test_needs_features = [features.lsprof_feature]
61
49
 
62
50
    def setUp(self):
63
51
        super(tests.TestCaseInTempDir, self).setUp()
97
85
 
98
86
class TestBzrProfiler(tests.TestCase):
99
87
 
100
 
    _test_needs_features = [LSProfFeature]
 
88
    _test_needs_features = [features.lsprof_feature]
101
89
 
102
90
    def test_start_call_stuff_stop(self):
103
91
        profiler = bzrlib.lsprof.BzrProfiler()