def run_keyword_and_expect_error(self, expected_error, name, *args):
        try:
            self.run_keyword(name, *args)
        except ExecutionFailed, err:
            if err.dont_cont:
                raise
        else:
            raise AssertionError("Expected error '%s' did not occur"
                                 % expected_error)
        if not self._matches(unicode(err), expected_error):
            raise AssertionError("Expected error '%s' but got '%s'"
                                 % (expected_error, err))
        return unicode(err)
Runs the keyword and checks that the expected error occurred.
dataset/ETHPy150Open shellderp/sublime-robot-plugin/lib/robot/libraries/BuiltIn.py/_RunKeyword.run_keyword_and_expect_error