判断是否是类,或者子类
作者:互联网
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里的子类
标签:case,TestSuite,判断,子类,是否是,TestCase,issubclass,test 来源: https://www.cnblogs.com/kxtomato/p/16504116.html