Home
last modified time | relevance | path

Searched refs:issubclass (Results 1 – 25 of 126) sorted by relevance

123456

/third_party/python/Lib/test/
Dtest_isinstance.py113 self.assertRaises(RuntimeError, issubclass, C(), S())
123 self.assertRaises(TypeError, issubclass, C(), S())
137 self.assertRaises(RuntimeError, issubclass, B, C())
147 self.assertRaises(TypeError, issubclass, B, C())
234 self.assertEqual(True, issubclass(Super, Super))
235 self.assertEqual(False, issubclass(Super, AbstractSuper))
236 self.assertEqual(False, issubclass(Super, Child))
238 self.assertEqual(True, issubclass(Child, Child))
239 self.assertEqual(True, issubclass(Child, Super))
240 self.assertEqual(False, issubclass(Child, AbstractSuper))
[all …]
Dtest_typechecks.py34 self.assertEqual(issubclass(int, Integer), True)
35 self.assertEqual(issubclass(int, (Integer,)), True)
36 self.assertEqual(issubclass(float, Integer), False)
37 self.assertEqual(issubclass(float, (Integer,)), False)
50 self.assertEqual(issubclass(Integer, Integer), True)
51 self.assertEqual(issubclass(Integer, (Integer,)), True)
54 self.assertEqual(issubclass(SubInt, Integer), True)
55 self.assertEqual(issubclass(SubInt, (Integer,)), True)
56 self.assertEqual(issubclass(SubInt, SubInt), True)
57 self.assertEqual(issubclass(SubInt, (SubInt,)), True)
[all …]
Dtest_abc.py279 self.assertFalse(issubclass(B, A))
280 self.assertFalse(issubclass(B, (A,)))
284 self.assertTrue(issubclass(B, A))
285 self.assertTrue(issubclass(B, (A,)))
292 self.assertTrue(issubclass(C, A))
293 self.assertTrue(issubclass(C, (A,)))
304 self.assertTrue(issubclass(B, A))
305 self.assertTrue(issubclass(B, (A,)))
312 self.assertTrue(issubclass(C, A))
313 self.assertTrue(issubclass(C, (A,)))
[all …]
Dtest_abstract_numbers.py10 self.assertTrue(issubclass(int, Integral))
11 self.assertTrue(issubclass(int, Complex))
21 self.assertFalse(issubclass(float, Rational))
22 self.assertTrue(issubclass(float, Real))
30 self.assertFalse(issubclass(complex, Real))
31 self.assertTrue(issubclass(complex, Complex))
Dtest_collections.py726 self.assertTrue(issubclass(C, abc))
730 self.assertFalse(issubclass(C, abc))
794 self.assertFalse(issubclass(type(x), Awaitable), repr(type(x)))
799 self.assertTrue(issubclass(type(x), Awaitable))
814 self.assertTrue(issubclass(CoroLike, Awaitable))
844 self.assertFalse(issubclass(type(x), Coroutine), repr(type(x)))
849 self.assertTrue(issubclass(type(x), Awaitable))
871 self.assertTrue(issubclass(CoroLike, Coroutine))
881 self.assertFalse(issubclass(CoroLike, Coroutine))
888 self.assertFalse(issubclass(type(x), Hashable), repr(type(x)))
[all …]
Dtest_datetime.py31 if issubclass(cls, unittest.TestCase):
33 elif issubclass(cls, unittest.TestSuite):
Dtest_baseexception.py13 self.assertTrue(issubclass(Exception, object))
26 if issubclass(object_, BaseException):
68 self.assertTrue(issubclass(exc, superclasses[-1][1]),
Dtest_winconsoleio.py20 self.assertTrue(issubclass(ConIO, io.RawIOBase))
21 self.assertFalse(issubclass(ConIO, io.BufferedIOBase))
22 self.assertFalse(issubclass(ConIO, io.TextIOBase))
Dtest_pickle.py395 if isinstance(attr, type) and issubclass(attr, BaseException):
426 self.assertTrue(issubclass(attr, OSError))
429 self.assertTrue(issubclass(attr, ImportError))
494 if exc is not OSError and issubclass(exc, OSError):
497 elif exc is not ImportError and issubclass(exc, ImportError):
Dtest_typing.py42 if not issubclass(cls, class_or_tuple):
49 if issubclass(cls, class_or_tuple):
84 issubclass(Employee, Any)
86 issubclass(Any, Employee)
93 issubclass(42, Any)
126 issubclass(Employee, NoReturn)
128 issubclass(NoReturn, Employee)
169 issubclass(int, T)
171 issubclass(T, int)
259 issubclass(int, Union)
[all …]
Dtest_contextlib_async.py77 self.assertTrue(issubclass(ManagerFromScratch, AbstractAsyncContextManager))
83 self.assertTrue(issubclass(DefaultEnter, AbstractAsyncContextManager))
88 self.assertFalse(issubclass(NoneAenter, AbstractAsyncContextManager))
93 self.assertFalse(issubclass(NoneAexit, AbstractAsyncContextManager))
/third_party/mindspore/tests/mindspore_test_framework/
Dmindspore_test.py48 if issubclass(component, IFacadeComponent):
50 elif issubclass(component, IDataComponent):
52 elif issubclass(component, IBuilderComponent):
54 elif issubclass(component, IExectorComponent):
56 elif issubclass(component, IVerifierComponent):
58 elif issubclass(component, IFIPolicyComponent):
60 elif issubclass(component, IERPolicyComponent):
/third_party/python/Lib/unittest/test/testmock/
Dtestcallable.py31 self.assertTrue(issubclass(MagicMock, Mock))
32 self.assertTrue(issubclass(NonCallableMagicMock, NonCallableMock))
37 self.assertTrue(issubclass(type(one.one), Mock))
40 self.assertTrue(issubclass(type(two.two), MagicMock))
48 self.assertTrue(issubclass(type(one.one), MockSub))
54 self.assertTrue(issubclass(type(two.two), MagicSub))
Dsupport.py6 return issubclass(type(obj), klass)
/third_party/python/Lib/
D_py_abc.py61 if issubclass(subclass, cls):
65 if issubclass(cls, subclass):
137 if issubclass(subclass, rcls):
142 if issubclass(subclass, scls):
Dstatistics.py225 if issubclass(S, T): return S
226 if issubclass(T, S): return T
228 if issubclass(T, int): return S
229 if issubclass(S, int): return T
231 if issubclass(T, Fraction) and issubclass(S, float):
233 if issubclass(T, float) and issubclass(S, Fraction):
270 if issubclass(T, int) and value.denominator != 1:
276 if issubclass(T, Decimal):
Dwarnings.py146 assert issubclass(category, Warning), "category must be a Warning subclass"
267 if not issubclass(cat, Warning):
295 if not (isinstance(category, type) and issubclass(category, Warning)):
354 issubclass(category, cat) and
Dfunctools.py715 if issubclass(cls, base) and not any(
716 issubclass(b, base) for b in cls.__bases__
744 and issubclass(cls, typ))
761 if sub not in bases and issubclass(cls, sub):
792 and not issubclass(match, t)):
/third_party/mindspore/mindspore/_extends/graph_kernel/expanders/
D_utils.py120 if not issubclass(cls, Expander):
143 if not issubclass(cls, Expander):
160 if not issubclass(cls, Expander):
/third_party/python/Lib/sqlite3/test/
Ddbapi.py48 self.assertTrue(issubclass(sqlite.Warning, Exception),
52 self.assertTrue(issubclass(sqlite.Error, Exception),
56 self.assertTrue(issubclass(sqlite.InterfaceError, sqlite.Error),
60 self.assertTrue(issubclass(sqlite.DatabaseError, sqlite.Error),
64 self.assertTrue(issubclass(sqlite.DataError, sqlite.DatabaseError),
68 self.assertTrue(issubclass(sqlite.OperationalError, sqlite.DatabaseError),
72 self.assertTrue(issubclass(sqlite.IntegrityError, sqlite.DatabaseError),
76 self.assertTrue(issubclass(sqlite.InternalError, sqlite.DatabaseError),
80 self.assertTrue(issubclass(sqlite.ProgrammingError, sqlite.DatabaseError),
84 self.assertTrue(issubclass(sqlite.NotSupportedError,
/third_party/boost/tools/build/src/build/
Dscanner.py59 assert issubclass(scanner_class, Scanner)
72 assert issubclass(scanner_class, Scanner)
/third_party/python/Lib/test/support/
Dwarnings_helper.py18 testcase.assertTrue(issubclass(warn.category, SyntaxWarning),
170 issubclass(warning.__class__, cat)):
/third_party/python/Lib/unittest/
Dloader.py86 if issubclass(testCaseClass, suite.TestSuite):
123 if isinstance(obj, type) and issubclass(obj, case.TestCase):
192 elif isinstance(obj, type) and issubclass(obj, case.TestCase):
196 issubclass(parent, case.TestCase)):
/third_party/python/Lib/ctypes/
D_endian.py19 if issubclass(typ, Structure):
/third_party/mindspore/mindspore/ops/
D_register_for_op.py31 elif issubclass(prim, Primitive):

123456