What class will you inherit from if you create a test case (framework unittest)?
What class will you inherit from if you create a test case (framework unittest)?
a. unittest.TestCase
b. unittest.UnitTest
c. unitest.TestLoader
d. unittest.TestSuite
e. unittest.TestRunner
1 Answers
a. unittest.TestCase
Explanation:
The basic building blocks of unit testing are test cases — single scenarios that must be set up and checked for correctness. In unittest, test cases are represented by unittest.TestCase instances. To make your own test cases you must write subclasses of TestCase or use FunctionTestCase.