/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/script.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-13 07:55:13 UTC
  • mfrom: (5492 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5501.
  • Revision ID: v.ladeuil+lp@free.fr-20101013075513-hil6q8xi7i9e3ozq
Merge bzr.dev fixing NEWS entry

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
        retcode, actual_output, actual_error = method(test_case,
224
224
                                                      str_input, args)
225
225
 
226
 
        self._check_output(output, actual_output, test_case)
227
 
        self._check_output(error, actual_error, test_case)
 
226
        try:
 
227
            self._check_output(output, actual_output, test_case)
 
228
        except AssertionError, e:
 
229
            raise AssertionError(str(e) + " in stdout of command %s" % cmd)
 
230
        try:
 
231
            self._check_output(error, actual_error, test_case)
 
232
        except AssertionError, e:
 
233
            raise AssertionError(str(e) +
 
234
                " in stderr of running command %s" % cmd)
228
235
        if retcode and not error and actual_error:
229
236
            test_case.fail('In \n\t%s\nUnexpected error: %s'
230
237
                           % (' '.join(cmd), actual_error))
231
238
        return retcode, actual_output, actual_error
232
239
 
233
240
    def _check_output(self, expected, actual, test_case):
234
 
        if expected is None:
235
 
            # Specifying None means: any output is accepted
236
 
            return
237
 
        if actual is None:
238
 
            test_case.fail('We expected output: %r, but found None'
239
 
                           % (expected,))
 
241
        if not actual:
 
242
            if expected is None:
 
243
                return
 
244
            elif expected == '...\n':
 
245
                return
 
246
            else:
 
247
                test_case.fail('expected output: %r, but found nothing'
 
248
                            % (expected,))
 
249
        expected = expected or ''
240
250
        matching = self.output_checker.check_output(
241
251
            expected, actual, self.check_options)
242
252
        if not matching: