判断是否是类,或者子类
if isinstance(test, type) and issubclass(test,(case.TestCase, TestSuite)):
raise TypeError("TestCases and TestSuites must be instantiated "
"before passing them to addTest()")
- isinstance(test, type) 判断是否是类
- issubclass(test,(case.TestCase, TestSuite))判断test是不是case.TestCase, TestSuite里的子类