来源:https://stackoverflow.com/questions/27637653/how-to-test-an-infinite-while-loop-with-pytest 标签 python unit-testing mocking pytest monkeypatching