-k 组合调用执行部分用例
场景:只执行符合要求的某一部分用例,通过类与方法的命名实
现。通常编写测试方法时 • 解决:使用-k
•
pytest -k "TestClass and test_one"
• pytest -k "TestClass or test_one"
• TestClass是类名,and是运算符,还可以是and not..., test_one是方法名中含有的信息。
现。通常编写测试方法时 • 解决:使用-k
•
pytest -k "TestClass and test_one"
• pytest -k "TestClass or test_one"
• TestClass是类名,and是运算符,还可以是and not..., test_one是方法名中含有的信息。