I would like to create a subclass of python’s unittest.Testcase called BasicTest. I would like each subclass of BasicTest to run the same routine in main. How can I accomplish this?
Example:
in basic_test.py:
class BasicTest(unittest.TestCase):
...
if __name__ == '__main__':
# Do optparse stuff
unittest.main()
in some_basic_test.py:
class SomeBasicTest(BasicTest):
...
if __name__ == '__main__':
#call the main in basic_test.py
1 Answer