~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lsprof.py

  • Committer: Martin Pool
  • Date: 2010-09-10 06:24:23 UTC
  • mto: This revision was merged to the branch mainline in revision 5426.
  • Revision ID: mbp@sourcefrog.net-20100910062423-8i2bldoclqaf41b6
Remove 'default' parameter from confirm_action
The noninteractive default is to always confirm

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009, 2010, 2011 Canonical Ltd
 
1
# Copyright (C) 2007, 2009, 2010 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
21
22
import threading
22
23
 
23
24
import bzrlib
24
25
from bzrlib import errors, tests
25
 
from bzrlib.tests import (
26
 
    features,
27
 
    )
 
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()
28
40
 
29
41
 
30
42
_TXT_HEADER = "   CallCount    Recursive    Total(ms)   " + \
45
57
 
46
58
class TestStatsSave(tests.TestCaseInTempDir):
47
59
 
48
 
    _test_needs_features = [features.lsprof_feature]
 
60
    _test_needs_features = [LSProfFeature]
49
61
 
50
62
    def setUp(self):
51
63
        super(tests.TestCaseInTempDir, self).setUp()
85
97
 
86
98
class TestBzrProfiler(tests.TestCase):
87
99
 
88
 
    _test_needs_features = [features.lsprof_feature]
 
100
    _test_needs_features = [LSProfFeature]
89
101
 
90
102
    def test_start_call_stuff_stop(self):
91
103
        profiler = bzrlib.lsprof.BzrProfiler()