通过py.test --pdb选项使用ipdb而不是pdb [英] Use ipdb instead of pdb with py.test --pdb option

查看:186
本文介绍了通过py.test --pdb选项使用ipdb而不是pdb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 ipdb 而不是 pdb noreferrer> py.test --pdb 选项.这可能吗?如果可以,怎么办?

I want to use ipdb instead of pdb with py.test --pdb option. Is this possible? If so, how?

很明显,我可以在代码中使用import ipdb; ipdb.set_trace(),但这需要运行测试,观察它是否失败,打开一个文件,在该文件中查找失败点,编写以上行,然后重新运行测试.如果我能通过所有这些事情,那么会很麻烦.

Clearly, I can use import ipdb; ipdb.set_trace() in the code but that requires to run the test, watch it fail, open a file, find the point of failure in said file, write the above line, re-run the tests. Lots of hassle if I could have something that by passes all of that.

推荐答案

您是否尝试过 pytest-ipdb ?

看起来正是您要找的东西吗?

Looks like it's exactly what you are looking for?

这篇关于通过py.test --pdb选项使用ipdb而不是pdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆