~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

pychecker cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import bzrlib.inventory
34
34
import bzrlib.merge3
35
35
import bzrlib.osutils
36
 
import bzrlib.osutils as osutils
37
36
import bzrlib.plugin
38
37
import bzrlib.store
39
38
import bzrlib.trace
97
96
        # at the end
98
97
        SHOW_DESCRIPTIONS = False
99
98
        if self.showAll:
100
 
            width = osutils.terminal_width()
 
99
            width = bzrlib.osutils.terminal_width()
101
100
            name_width = width - 15
102
101
            what = None
103
102
            if SHOW_DESCRIPTIONS:
325
324
 
326
325
        This should only be called from TestCase.tearDown.
327
326
        """
328
 
        for callable in reversed(self._cleanups):
329
 
            callable()
 
327
        for cleanup_fn in reversed(self._cleanups):
 
328
            cleanup_fn()
330
329
 
331
330
    def log(self, *args):
332
331
        mutter(*args)
549
548
 
550
549
    def failUnlessExists(self, path):
551
550
        """Fail unless path, which may be abs or relative, exists."""
552
 
        self.failUnless(osutils.lexists(path))
 
551
        self.failUnless(bzrlib.osutils.lexists(path))
553
552
        
554
553
    def assertFileEqual(self, content, path):
555
554
        """Fail if path does not contain 'content'."""
556
 
        self.failUnless(osutils.lexists(path))
 
555
        self.failUnless(bzrlib.osutils.lexists(path))
557
556
        self.assertEqualDiff(content, open(path, 'r').read())
558
557
        
559
558
 
560
559
def filter_suite_by_re(suite, pattern):
561
 
    result = TestUtil.TestSuite()
 
560
    result = TestSuite()
562
561
    filter_re = re.compile(pattern)
563
562
    for test in iter_suite_tests(suite):
564
563
        if filter_re.search(test.id()):