pytest—基本脚本编写运行

1、新建脚本【test_demo1.py】

def test_demo():
assert 100 == 100

2、在脚本目录下打开cmd

3、执行脚本

pytest test_demo1.py -v

参数说明:
  • -v:显示详细测试结果
  • -s:显示测试中的打印输出
  • -x:测试失败时立即停止

 

posted @ 2025-05-09 08:32  快乐的小太阳  阅读(9)  评论(0)    收藏  举报