问题
I am developing unit test for code that use Google oauth2client.tools run_flow()
. The problem is, this function will call Python webbrowser.open()
, that will eventually (cmiiw), exit itself by calling sys.exit()
. Therefore, even if I halt the code execution using threading.Event.wait()
, it will eventually terminate, without continuing the rest of the unit testing code.
I have read this SO answer that previously was my problem, but now I still faced with this webbrowser.open()
issue.
Any idea on how to solve this?
来源:https://stackoverflow.com/questions/31879381/how-to-prevent-unit-testing-from-exiting-when-calling-webbrowser-open