~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

Raise NoDiff if 'diff' not present.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from tempfile import TemporaryFile
21
21
 
22
22
from bzrlib.diff import internal_diff, external_diff, show_diff_trees
23
 
from bzrlib.errors import BinaryFile
 
23
from bzrlib.errors import BinaryFile, NoDiff
24
24
import bzrlib.patiencediff
25
25
from bzrlib.tests import (TestCase, TestCaseWithTransport,
26
26
                          TestCaseInTempDir, TestSkipped)
37
37
    output = TemporaryFile()
38
38
    try:
39
39
        external_diff('old', old, 'new', new, output, diff_opts=['-u'])
40
 
    except OSError, e:
41
 
        # if the diff program could not be found, skip the test
42
 
        if e.errno == errno.ENOENT:
43
 
            raise TestSkipped
 
40
    except errors.NoDiff:
 
41
        raise TestSkipped('external "diff" not present to test')
44
42
    output.seek(0, 0)
45
43
    lines = output.readlines()
46
44
    output.close()