Python 如何使用场景大纲继续执行Pytest BDD中的步骤

Python 如何使用场景大纲继续执行Pytest BDD中的步骤,python,pytest,bdd,gherkin,pytest-bdd,Python,Pytest,Bdd,Gherkin,Pytest Bdd,我正在尝试实现一个功能场景大纲,类似于以下内容: Feature: Scenario outlines Scenario Outline: Outlined given, when, then Given there are <start> cucumbers Given there are <start> apples When I eat <eat> cucumbers When I

我正在尝试实现一个功能场景大纲,类似于以下内容:

Feature: Scenario outlines
    Scenario Outline: Outlined given, when, then
        Given there are <start> cucumbers
        Given there are <start> apples
        When I eat <eat> cucumbers
        When I eat <eat> apples
        Then I should have <left_c> cucumbers
        Then I should have <left_a> apples

        Examples:
        | start | eat | left_c | left_a |
        |  12   |  5  |  4     | 7      |
功能:场景概述
场景大纲:概述给定时间,然后
因为有黄瓜
因为有苹果
当我吃黄瓜的时候
当我吃苹果的时候
那我应该吃黄瓜
那么我应该吃苹果
示例:
|开始|吃|左| c |左| a|
|  12   |  5  |  4     | 7      |
在这里,
我应该让黄瓜
将失败,执行将停止,而不考虑第二步。
即使pytest bdd中的某些步骤失败,是否有办法执行其余步骤?

可能您只需要使用验证而不是断言来定义“我应该有黄瓜”的代码实现。可以在report.html中捕获验证以查看失败原因。同时,代码也将继续执行下一个“Then”语句,不会出现任何问题。 由于问题中没有添加代码实现,因此无法进一步帮助