~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Robert Collins
  • Date: 2010-05-27 17:59:18 UTC
  • mfrom: (4797.43.14 2.1)
  • mto: This revision was merged to the branch mainline in revision 5264.
  • Revision ID: robertc@robertcollins.net-20100527175918-un0gcxr0n9or5tb3
Tags: bzr-2.2b3
ReleaseĀ 2.2b3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1910
1910
 
1911
1911
class TestTerminalWidth(tests.TestCase):
1912
1912
 
 
1913
    def setUp(self):
 
1914
        tests.TestCase.setUp(self)
 
1915
        self._orig_terminal_size_state = osutils._terminal_size_state
 
1916
        self._orig_first_terminal_size = osutils._first_terminal_size
 
1917
        self.addCleanup(self.restore_osutils_globals)
 
1918
        osutils._terminal_size_state = 'no_data'
 
1919
        osutils._first_terminal_size = None
 
1920
 
 
1921
    def restore_osutils_globals(self):
 
1922
        osutils._terminal_size_state = self._orig_terminal_size_state
 
1923
        osutils._first_terminal_size = self._orig_first_terminal_size
 
1924
        
1913
1925
    def replace_stdout(self, new):
1914
1926
        self.overrideAttr(sys, 'stdout', new)
1915
1927