代码之家  ›  专栏  ›  技术社区  ›  GPT14

在robotframework中不停止测试执行的情况下使关键字失败

  •  0
  • GPT14  · 技术社区  · 7 年前

    def test_keyword():
        logger.error("Report error")
    

    这将在log.html文件中的关键字下创建一个错误行,但不会使关键字失败。

    def test_keyword():
        raise Exception("Not implemented")
    

    是否有任何方法可以在不停止测试用例执行的情况下使关键字失败?

    1 回复  |  直到 7 年前
        1
  •  1
  •   GPT14    7 年前

    documentation 以下内容:

    Several failures occurred:
    
    1) First error message.
    
    2) Second error message ...
    

    class MyContinuableError(RuntimeError):
        ROBOT_CONTINUE_ON_FAILURE = True