~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

terminal_width can now returns None.

* bzrlib/win32utils.py:
(get_console_size): Fix typo in comment.

* bzrlib/ui/text.py:
(TextProgressView._show_line): Handle the no terminal present case.

* bzrlib/tests/test_osutils.py:
(TestTerminalWidth): Update tests.

* bzrlib/tests/blackbox/test_too_much.py:
Fix some imports.
(OldTests.test_bzr): Handle the no terminal present case.

* bzrlib/tests/__init__.py:
(VerboseTestResult.report_test_start): Handle the no terminal
present case.

* bzrlib/status.py:
(show_pending_merges): Handle the no terminal present case.
(show_pending_merges.show_log_message): Factor out some
code. Handle the no terminal present case.

* bzrlib/osutils.py:
(terminal_width): Return None if no precise value can be found.

* bzrlib/log.py:
(LineLogFormatter.__init__): Handle the no terminal present case.
(LineLogFormatter.truncate): Accept None as max_len meaning no
truncation.
(LineLogFormatter.log_string): 

* bzrlib/help.py:
(_help_commands_to_text): Handle the no terminal present case.

Show diffs side-by-side

added added

removed removed

Lines of Context:
562
562
    def report_test_start(self, test):
563
563
        self.count += 1
564
564
        name = self._shortened_test_description(test)
565
 
        # width needs space for 6 char status, plus 1 for slash, plus an
566
 
        # 11-char time string, plus a trailing blank
567
 
        # when NUMBERED_DIRS: plus 5 chars on test number, plus 1 char on space
568
 
        self.stream.write(self._ellipsize_to_right(name,
569
 
                          osutils.terminal_width()-18))
 
565
        width = osutils.terminal_width()
 
566
        if width is not None:
 
567
            # width needs space for 6 char status, plus 1 for slash, plus an
 
568
            # 11-char time string, plus a trailing blank
 
569
            # when NUMBERED_DIRS: plus 5 chars on test number, plus 1 char on
 
570
            # space
 
571
            self.stream.write(self._ellipsize_to_right(name, width-18))
 
572
        else:
 
573
            self.stream.write(name)
570
574
        self.stream.flush()
571
575
 
572
576
    def _error_summary(self, err):