~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__static_tuple.py

  • Committer: Jelmer Vernooij
  • Date: 2016-04-03 16:32:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6617.
  • Revision ID: jelmer@jelmer.uk-20160403163231-h72bo0uyek2gikw0
Don't put French text in doc/en/user-reference when LANGUAGE=fr_CH.UTF_8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    static_tuple,
27
27
    tests,
28
28
    )
 
29
from bzrlib.tests import (
 
30
    features,
 
31
    )
29
32
 
30
33
 
31
34
def load_tests(standard_tests, module, loader):
37
40
    return suite
38
41
 
39
42
 
40
 
class _Meliae(tests.Feature):
41
 
 
42
 
    def _probe(self):
43
 
        try:
44
 
            from meliae import scanner
45
 
        except ImportError:
46
 
            return False
47
 
        return True
48
 
 
49
 
    def feature_name(self):
50
 
        return "Meliae - python memory debugger"
51
 
 
52
 
Meliae = _Meliae()
53
 
 
54
 
 
55
43
class TestStaticTuple(tests.TestCase):
56
44
 
57
45
    def assertRefcount(self, count, obj):
444
432
        # amount of referenced memory. Unfortunately gc.get_referents() first
445
433
        # checks the IS_GC flag before it traverses anything. We could write a
446
434
        # helper func, but that won't work for the generic implementation...
447
 
        self.requireFeature(Meliae)
 
435
        self.requireFeature(features.meliae)
448
436
        from meliae import scanner
449
437
        strs = ['foo', 'bar', 'baz', 'bing']
450
438
        k = self.module.StaticTuple(*strs)
455
443
        self.assertEqual(sorted(refs), sorted(scanner.get_referents(k)))
456
444
 
457
445
    def test_nested_referents(self):
458
 
        self.requireFeature(Meliae)
 
446
        self.requireFeature(features.meliae)
459
447
        from meliae import scanner
460
448
        strs = ['foo', 'bar', 'baz', 'bing']
461
449
        k1 = self.module.StaticTuple(*strs[:2])