摘要: pytest.ini官网配置选项 注册标记标签 请注意,:标记名称之后的所有内容都是可选描述。 [pytest] markers = slow: marks tests as slow (deselect with '-m "not slow"') serial addopts 强制校验标签 没有注 阅读全文
posted @ 2022-06-29 18:03 zhq9 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 介绍 pytest.mark.skipif可以根据条件判断是否执行该用例, 第一个参数传入条件 可以传入True/False如果条件应该被跳过或条件字符串 第二个参数是说明/原因 reason="2大于1" 有条件的跳过用例 import pytest @pytest.mark.skipif(1<2 阅读全文
posted @ 2022-06-29 16:21 zhq9 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 介绍 您可以标记无法在某些平台上运行或您预计会失败的测试功能,以便 pytest 可以相应地处理它们并提供测试会话的摘要,同时保持测试套件绿色。 跳过意味着您希望测试仅在满足某些条件时才能通过,否则 pytest 应该完全跳过运行测试。常见的例子是跳过非 Windows 平台上的纯 Windows 阅读全文
posted @ 2022-06-29 15:22 zhq9 阅读(75) 评论(0) 推荐(0) 编辑