当前位置:网站首页>pytest接口自动化测试框架 | 执行失败跳转pdb
pytest接口自动化测试框架 | 执行失败跳转pdb
2022-08-01 07:12:00 【COCOgsta】
视频来源:B站《冒死上传!pytest接口自动化测试框架(基础理论到项目实战及二次开发)教学视频【软件测试】》
一边学习一边整理老师的课程内容及试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:pytest接口自动化测试框架 | 汇总_COCOgsta的博客-CSDN博客
pdb是python标准库的调试模块。在Pytest中,可以直接使用--pdb参数在测试失败时开始调试:
pytest --pdb # 每次遇到失败都跳转到PDB
pytest -x --pdb # 第一次遇到失败就跳转到PDB,结束测试执行
pytest --pdb --maxfail=3# 只有前三次失败跳转到PDB pdb提示符出现后,便可以使用pdb的交互调试功能,查看错误时,有以下常用命令:
p/print expr: 输出变量expr的值
pp expr: 美化输出expr的值
l/list: 列出错误并显示错误之前和之后的5行代码
l/list begin, end: 列出错误,并显示指定行号之间的代码
a/args: 移动到堆栈的上一层
d/down: 移动到堆栈的下一层
q/quit: 退出当前调试会话(也会退出测试会话)在控制台与pdb进行交互
边栏推荐
猜你喜欢

Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download

实战演练 Navicat 中英文模式切换

The BP neural network based on MATLAB voice characteristic signal classification

MATLAB program design and application of MATLAB 2.5

app 自动化 通过工具查看app 元素 (三)

Data organization -- singly linked list of the linear table
![Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]](/img/7f/08b323ffc5b5f8e3354bee6775b994.png)
Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]

Zero-code website development tool: WordPress

我说过无数遍了:从来没有一种技术是为灵活组合这个目标而设计的

【视觉SLAM十四讲】第一章理论详解
随机推荐
搜索框字符自动补全
湖仓一体电商项目(一):项目背景和架构介绍
【FiddlerScript】利用FiddlerScript抓包保利威下载
Golang:go开启web服务
旋度(7)连接失败localhost8080;连接拒绝了
信息系统项目管理师必背核心考点(五十六)配置控制委员会(CCB)的工作
最小生成树
C语言学习概览(一)
weight distribution
JSON 与 JS 对象的区别
Golang:go连接和使用mysql
NIO programming
Self-made a remote control software - VeryControl
上课作业(7)——#598. 取余运算(mod)
我说过无数遍了:从来没有一种技术是为灵活组合这个目标而设计的
爬虫框架 Scrapy 详解
special day to remember
POJ2031空间站题解
Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]
Data organization -- singly linked list of the linear table