如何不打印跳过的标记

2024-04-27 02:53:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用Selenium和Cucumber/Behave在Python中测试一个web应用程序。随着测试数量的增长,我使用标记将测试分为多个部分。但是,当我运行测试时,跳过的测试仍然打印。他们确实在每一步的末尾都有一个“无”,但是在跳过的测试页面中搜索越来越难。我正在寻找一种只打印那些运行的测试的方法。你知道吗

运行时:

 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   

Tags: thepytestnoneonsteppagesteps