简体   繁体   English

Python进程不会退出

[英]Python process will not exit

I'm use nosetests to run some tests. 我使用nosetests进行一些测试。 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? Python是否具有类似于向Java发送kill -QUIT的工具,它将打印堆栈跟踪?

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" 其中-x是“在第一次错误或失败后停止运行测试”,而--pdb“在出现故障或错误时 掉入 调试器”

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

You can enter the debugger and type bt : 您可以输入调试器并键入bt

import pdb; pdb.set_trace()

Then you can step through the operation and see where it hangs. 然后,您可以单步执行操作并查看它挂起的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM