python unittest run specific test class code example
Example 1: unittest run specific test
python -m unittest mypkg.tests.test_module.TestClass.test_method
python -m unittest testMyCase.MyCase.testItIsHot
Example 2: python unittest setUpClass
class MyUnitTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
do_something_expensive_for_all_sets_of_tests()
class MyFirstSetOfTests(MyUnitTest):
@classmethod
def setUpClass(cls):
super(MyFirstSetOfTests, cls).setUpClass()
do_something_expensive_for_just_these_first_tests()