# pytest-demo **Repository Path**: panc-test/pytest-demo ## Basic Information - **Project Name**: pytest-demo - **Description**: pytest测试框架学习 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-06-21 - **Last Updated**: 2023-03-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: pytest ## 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