[tests] Add additional magic tests
@@ -79,6 +79,12 @@ class TestMagicOps(TestCase):
self.assertIsInstance(a, Shaped)
self.assertIsInstance(a, Sliceable)
self.assertIsInstance(a, Shapable)
+ self.assertNotIsInstance('test', Shaped)
+ class S:
+ def __shape__(self):
+ return batch()
+ self.assertIsInstance(S(), Shaped)
+ self.assertNotIsInstance(S(), Shapable)
def test_shape(self):
for test_class in TEST_CLASSES:
