【发布时间】:2018-09-17 22:10:31
【问题描述】:
有没有办法在 pytest 中为测试添加属性,例如“烟雾测试”或“回归”,然后只运行这些测试?
【问题讨论】:
有没有办法在 pytest 中为测试添加属性,例如“烟雾测试”或“回归”,然后只运行这些测试?
【问题讨论】:
是的,您可以为此使用标记。
见"Marking test functions and selecting them for a run"
基本上,您将使用@pytest.mark.smoke“标记”您的一些测试,然后使用$ pytest -m smoke 之类的命令启动它们。
【讨论】: