【问题标题】:Executing specific tests using pytest使用 pytest 执行特定测试
【发布时间】:2018-09-17 22:10:31
【问题描述】:

有没有办法在 pytest 中为测试添加属性,例如“烟雾测试”或“回归”,然后只运行这些测试?

【问题讨论】:

标签: python pytest


【解决方案1】:

是的,您可以为此使用标记。

"Marking test functions and selecting them for a run"

基本上,您将使用@pytest.mark.smoke“标记”您的一些测试,然后使用$ pytest -m smoke 之类的命令启动它们。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-14
    • 1970-01-01
    • 1970-01-01
    • 2022-09-24
    • 2019-09-18
    • 2013-07-08
    • 1970-01-01
    相关资源
    最近更新 更多