MCPcopy Create free account
hub / github.com/pytorch/pytorch / testListSubclassClone

Method testListSubclassClone

caffe2/python/schema_test.py:51–59  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

49 self.assertTrue(getattr(r, 'non_existent', None) is None)
50
51 def testListSubclassClone(self):
52 class Subclass(schema.List):
53 pass
54
55 s = Subclass(schema.Scalar())
56 clone = s.clone()
57 self.assertIsInstance(clone, Subclass)
58 self.assertEqual(s, clone)
59 self.assertIsNot(clone, s)
60
61 def testListWithEvictedSubclassClone(self):
62 class Subclass(schema.ListWithEvicted):

Callers

nothing calls this directly

Calls 3

SubclassClass · 0.85
cloneMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected