0 Star 0 Fork 1

panc-test / pytest-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

pytest-demo

1、demo介绍

pytest单元测试框架学习笔记

2、文件夹介绍

testcases:测试用例
report:测试报告
logs:日志

testorder: pytest-order插件管理测试用例执行顺序
testmark:标记
testfixture:夹具
testfunction:Function
testlog:日志管理

3、pytest常见命令行参数

-h : 获取帮助信息
-v : 输出详细信息
-q : 输出简要信息
-s : 显示 print 信息
[-r chars]:显示chars指定的额外测试摘要信息,默认fE。 如:-ra 会显示passed之外的所有信息。

(f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output,
(a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default (see --disable-warnings),
'N' can be used to reset the list. (default:'fE').

[-k EXPRESSION] : 仅运行与给定子字符串表达式匹配的测试,匹配不区分大小写。
[-m MARKEXPR] : 执行 mark 标记的测试用例
[-x, --exitfirst] : 遇到第一个 error 或 failed 的测试用例立即退出
[--lf, --last-failed] : 重跑上次失败的 tests,如果没有失败就重跑全部

4、pytest合集博客地址

https://blog.csdn.net/panc_guizaijianchi/category_11892553.html

5、参考地址

https://www.tutorialspoint.com/pytest/index.htm
https://docs.pytest.org/en/stable/contents.html
https://www.cnblogs.com/superhin/p/11677240.html

空文件

简介

pytest测试框架学习 展开 收起
Python
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/panc-test/pytest-demo.git
git@gitee.com:panc-test/pytest-demo.git
panc-test
pytest-demo
pytest-demo
master

搜索帮助