~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-30 20:33:06 UTC
  • mfrom: (4807.3.4 2.1.0b4-test-kipple)
  • Revision ID: pqm@pqm.ubuntu.com-20091130203306-wut4brq0gaith8to
(jam) Reduce some test 'kipple'

Show diffs side-by-side

added added

removed removed

Lines of Context:
2405
2405
            # recreate a new one or all the followng tests will fail.
2406
2406
            # If you need to inspect its content uncomment the following line
2407
2407
            # import pdb; pdb.set_trace()
2408
 
            _rmtree_temp_dir(root + '/.bzr')
 
2408
            _rmtree_temp_dir(root + '/.bzr', test_id=self.id())
2409
2409
            self._create_safety_net()
2410
2410
            raise AssertionError('%s/.bzr should not be modified' % root)
2411
2411
 
2603
2603
 
2604
2604
    def deleteTestDir(self):
2605
2605
        os.chdir(TestCaseWithMemoryTransport.TEST_ROOT)
2606
 
        _rmtree_temp_dir(self.test_base_dir)
 
2606
        _rmtree_temp_dir(self.test_base_dir, test_id=self.id())
2607
2607
 
2608
2608
    def build_tree(self, shape, line_endings='binary', transport=None):
2609
2609
        """Build a test tree according to a pattern.
4131
4131
    return new_test
4132
4132
 
4133
4133
 
4134
 
def _rmtree_temp_dir(dirname):
 
4134
def _rmtree_temp_dir(dirname, test_id=None):
4135
4135
    # If LANG=C we probably have created some bogus paths
4136
4136
    # which rmtree(unicode) will fail to delete
4137
4137
    # so make sure we are using rmtree(str) to delete everything
4149
4149
        # We don't want to fail here because some useful display will be lost
4150
4150
        # otherwise. Polluting the tmp dir is bad, but not giving all the
4151
4151
        # possible info to the test runner is even worse.
 
4152
        if test_id != None:
 
4153
            ui.ui_factory.clear_term()
 
4154
            sys.stderr.write('While running: %s\n' % (test_id,))
4152
4155
        sys.stderr.write('Unable to remove testing dir %s\n%s'
4153
4156
                         % (os.path.basename(dirname), e))
4154
4157