testing interactive python programs

后端 未结 3 2289
抹茶落季
抹茶落季 2021-02-20 18:21

I would like to know which testing tools for python support the testing of interactive programs. For example, I have an application launched by:

$ python dummy_p         


        
3条回答
  •  面向向阳花
    2021-02-20 19:05

    If you are testing an interactive program, consider using expect. It's designed specifically for interacting with console programs (though, more for automating tasks rather than testing).

    If you don't like the language expect is based on (tcl) you can try pexpect which also makes it easy to interact with a console program.

提交回复
热议问题