Python进程不会退出

发布于 2024-08-31 19:01:20 字数 116 浏览 1 评论 0原文

我正在使用鼻子测试来运行一些测试。然而,测试运行完成后,nosetests进程只是坐在那里,不会退出。有什么办法可以诊断这个吗? Python 是否有类似于向 Java 发送kill -QUIT 的功能来打印堆栈跟踪?

I'm use nosetests to run some tests. However, after the tests have finished running, the nosetests process just sits there, and will not exit. Is there anyway to diagnose this? Does Python have a facility similar to sending Java a kill -QUIT which will print a stack trace?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

傲性难收 2024-09-07 19:01:20
nosetests -vv -x -s --pdb test_foo

其中-x是“在第一个错误或失败后停止运行测试”,--pdb“在失败或错误时放入调试器”

另请参阅http://nose.readthedocs.org/en/latest/usage.html

nosetests -vv -x -s --pdb test_foo

where -x is "Stop running tests after the first error or failure" and --pdb is "Drop into debugger on failures or errors"

Also see http://nose.readthedocs.org/en/latest/usage.html

悲歌长辞 2024-09-07 19:01:20

您可以进入调试器并输入bt

import pdb; pdb.set_trace()

然后您可以单步执行操作并查看它挂在哪里。

You can enter the debugger and type bt:

import pdb; pdb.set_trace()

Then you can step through the operation and see where it hangs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文