Loading

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
posted @ 2020-08-18 15:58  封灵寒武  阅读(83)  评论(0编辑  收藏  举报