~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_diff.py

  • Committer: Martin Pool
  • Date: 2009-06-17 05:11:41 UTC
  • mto: This revision was merged to the branch mainline in revision 4454.
  • Revision ID: mbp@sourcefrog.net-20090617051141-lcylxd64rdipbnpz
test_diff doesn't need so much special code to set env vars

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
        # subprocess.py that we had to workaround).
361
361
        # However, if 'diff' may not be available
362
362
        self.make_example_branch()
363
 
        orig_progress = os.environ.get('BZR_PROGRESS_BAR')
364
 
        try:
365
 
            os.environ['BZR_PROGRESS_BAR'] = 'none'
366
 
            out, err = self.run_bzr_subprocess('diff -r 1 --diff-options -ub',
367
 
                                               universal_newlines=True,
368
 
                                               retcode=None)
369
 
        finally:
370
 
            if orig_progress is None:
371
 
                del os.environ['BZR_PROGRESS_BAR']
372
 
            else:
373
 
                os.environ['BZR_PROGRESS_BAR'] = orig_progress
374
 
 
 
363
        # this will be automatically restored by the base bzr test class
 
364
        os.environ['BZR_PROGRESS_BAR'] = 'none'
 
365
        out, err = self.run_bzr_subprocess('diff -r 1 --diff-options -ub',
 
366
                                           universal_newlines=True,
 
367
                                           retcode=None)
375
368
        if 'Diff is not installed on this machine' in err:
376
369
            raise TestSkipped("No external 'diff' is available")
377
370
        self.assertEqual('', err)