~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-12-04 10:59:49 UTC
  • mfrom: (4862.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091204105949-cp822ctg4bp7vgd4
(vila) BZR_COLUMNS can override terminal_width()

Show diffs side-by-side

added added

removed removed

Lines of Context:
533
533
    def report_test_start(self, test):
534
534
        self.count += 1
535
535
        name = self._shortened_test_description(test)
536
 
        # width needs space for 6 char status, plus 1 for slash, plus an
537
 
        # 11-char time string, plus a trailing blank
538
 
        # when NUMBERED_DIRS: plus 5 chars on test number, plus 1 char on space
539
 
        self.stream.write(self._ellipsize_to_right(name,
540
 
                          osutils.terminal_width()-18))
 
536
        width = osutils.terminal_width()
 
537
        if width is not None:
 
538
            # width needs space for 6 char status, plus 1 for slash, plus an
 
539
            # 11-char time string, plus a trailing blank
 
540
            # when NUMBERED_DIRS: plus 5 chars on test number, plus 1 char on
 
541
            # space
 
542
            self.stream.write(self._ellipsize_to_right(name, width-18))
 
543
        else:
 
544
            self.stream.write(name)
541
545
        self.stream.flush()
542
546
 
543
547
    def _error_summary(self, err):
1532
1536
            'TERM': 'dumb',
1533
1537
            'LINES': '25',
1534
1538
            'COLUMNS': '80',
 
1539
            'BZR_COLUMNS': '80',
1535
1540
            # SSH Agent
1536
1541
            'SSH_AUTH_SOCK': None,
1537
1542
            # Proxies