如何过去"按任意键继续......"在Python unittest中?

时间:2017-09-11 07:27:18

标签: python python-unittest

如何编写一个unittest,它会在合适的时间按下一个键,以便我可以测试下面的check方法,并且它不会永远等待按键。

class MyProject():
    def __init__(self):
        self.info = ""

    def check(self):
        # goes online to fetch data and saves it to self.info
        input("Press any key to continue...")

    def main_function(self):
        # this method does the main task

0 个答案:

没有答案