Python Unittest Example: Running a Single Test Case
The code provided creates a test suite and adds a single test case to it. The test case is an instance of the "Test" class and calls the "test2" method. Finally, the test suite is executed using the "TextTestRunner" class.
The output of this code will be:
2
This means that only the "test2" method will be executed and print the number 2.
原文地址: https://www.cveoy.top/t/topic/pO95 著作权归作者所有。请勿转载和采集!