常用命令行参数
所有命令行标志都可以通过运行 pytest --help
查看:
-v
输出用例更加详细的执行信息,比如用例所在的文件及用例名称等,执行pytest -v test_class.py
-s
输出用例中的调式信息,比如print的打印信息等,修改test_class.py如下,执行pytest -vs test_class.py
class TestClass:
def test_one(self):
x = "this"
print("测试调试信息1")
assert "h" in x
def test_two(self):
x