Python CLI program unit testing

后端 未结 9 2180
日久生厌
日久生厌 2020-12-24 12:43

I am working on a python Command-Line-Interface program, and I find it boring when doing testings, for example, here is the help information of the program:

         


        
9条回答
  •  轮回少年
    2020-12-24 13:15

    You can use standard unittest module:

    # python -m unittest 
    

    or use nose as a testing framework. Just write classic unittest files in separate directory and run:

    # nosetests 
    

    Writing unittests is easy. Just follow online manual for unittesting

提交回复
热议问题