~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Add run_bzr_errors alongside run_bzr, to make it easy to check the right error is occurring.

Show diffs side-by-side

added added

removed removed

Lines of Context:
739
739
            encoding = bzrlib.user_encoding
740
740
        return self.run_bzr(*args, **kwargs)[0].decode(encoding)
741
741
 
 
742
    def run_bzr_error(self, error_regexes, *args, **kwargs):
 
743
        """Run bzr, and check that stderr contains the supplied regexes"""
 
744
        out, err = self.run_bzr(*args, **kwargs)
 
745
        for regex in error_regexes:
 
746
            self.assertContainsRe(err, regex)
 
747
 
742
748
    def run_bzr_subprocess(self, *args, **kwargs):
743
749
        """Run bzr in a subprocess for testing.
744
750