# pytest_demo **Repository Path**: listen-zhang/pytest_demo ## Basic Information - **Project Name**: pytest_demo - **Description**: No description available - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-16 - **Last Updated**: 2024-12-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pytest pytest.exe =============================================================== test session starts =============================================================== platform win32 -- Python 3.10.11, pytest-8.3.4, pluggy-1.5.0 rootdir: C:\Users\Admin\important\pytest_demo collected 0 items # 常用命令 ```shell pytest -q 简洁输出 -s 输出print信息 -v 显示详细信息 -r 总结报告 用法 -rA ·f:失败的; ·E:出错的; ·s:跳过执行的; ·x:跳过执行,并标记为xfailed的; ·X:跳过执行,并标记为xpassed的; ·p:测试通过的; ·P:测试通过,并且有输出信息的,即用例中有print等; ·a:除了测试通过的,其他所有的,即除了p和P的; ·A:所有的。 -k 执行包含特定关键字的测试用例 -q --collect-only 查看用例名 -m 执行指定标记的用例 --pyargs 指定包中的测试用例 -x 遇到第一个失败就退出执行 --maxfail=2 遇到第2个失败就退出执行 可以执行失败次数 ```