import sys import unittest import tests.ApiTest if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromModule(tests.ApiTest) \ if len(sys.argv) < 2 \ else unittest.TestLoader().loadTestsFromNames( ['tests.ApiTest.ApiTestCase.test_%sCases' % (s) for s in sys.argv[1:]]) unittest.TextTestRunner(verbosity=2).run(suite)