pytest

1.下载

pip install -U pytest

2.运行
规则

  • 测试文件以test_开头(以_test结尾也可以)
  • 测试类以Test开头,并且不能带有 init 方法
  • 测试函数以test_开头
  • 断言使用assert
pytest 指定想执行的文件路径 --html=./reports/report.html --self-contained-html

指定位置以及文件名称
./report/report.html

把css样式合并到html里
--self-contained-html
原文地址:https://www.cnblogs.com/flhw/p/13524028.html