如何不打印跳过的标签

How do I not print skipped tags

我正在 Python 中使用 Selenium 和 Cucumber/Behave 测试 Web 应用程序。随着测试数量的增加,我使用标签将测试分成几个部分。但是,当我 运行 测试时 - 跳过的测试仍然打印。他们确实在每个步骤的末尾都有一个#None,但是搜索跳过的测试页面变得越来越难处理。我正在寻找一种方法来只打印那些 运行.

的测试

当运行:

 Feature: Testing alerts             # features/alerts.feature:1
    Scenario: Test Alert on Change      # features/alerts.feature:3
    Given I start on the main page      # steps/step_definitions.py:32 6.297s
    When I click on "Next"              # steps/step_definitions.py:478 5.369s
    Then I am on the "Information page" # steps/step_definitions.py:638 0.869s

当不是运行时:

    Feature: Testing alerts             # None
    Scenario: Test Alert on Change      # None
    Given I start on the main page      # None
    When I click on "Next"              # None
    Then I am on the "Information page" # None   

一位比我聪明得多的同事找到了答案。 Behave 有一个命令行选项可以不打印跳过的测试:
-k
Behave Command Line Options