~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_tree.py

Rather use assertRaises in test_changes_from_with_require_versioned

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
        self.build_tree(['known_file', 'unknown_file'])
129
129
        wt.add('known_file')
130
130
 
131
 
        try:
132
 
            delta = wt.changes_from(wt.basis_tree(), wt,
133
 
                specific_files=['known_file', 'unknown_file'] ,
134
 
                require_versioned=True)
135
 
            self.fail('Expected PathsNotVersionedError to be thrown when '
136
 
                'passing a known and unknown file to tree.changes_from '
137
 
                'and specifying require_versioned.')
138
 
        except errors.PathsNotVersionedError, e :
139
 
            pass
 
131
        self.assertRaises(errors.PathsNotVersionedError,
 
132
            wt.changes_from, wt.basis_tree(), wt, specific_files=['known_file',
 
133
            'unknown_file'], require_versioned=True)
140
134
 
141
135
        # we need to pass a known file with an unknown file to get this to
142
136
        # fail when expected.