当前位置:网站首页>Test case writing specification in unittest framework and how to run test cases

Test case writing specification in unittest framework and how to run test cases

2022-07-01 11:12:00 Field test record

1、 Writing specifications

1) Test cases need to be written in test start , and test The following characters follow ASCII Code sorting operation

2) Test cases must be written in inheritance unittest.TestCase Class in

2、 Operation mode

1) Use PyCharm Built in unittest function , Unwanted main function

Operation rules :

TestLoader When loading test cases , First, load according to the file path , Find the corresponding module , Then find the corresponding class to run .

 

2) Use unittest.main function , The operation mode needs to be modified in the upper right corner .

remarks : If you want to modify the prefix of the running case, you can change it in the following way loader.py In file , hold test Change to another string

testMethodPrefix='test'

 

 

 

原网站

版权声明
本文为[Field test record]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207011107212614.html