Files
onepilot/tinygrad_repo/test/unit/test_objc.py
T
Vehicle Researcher 6adb63b915 openpilot v0.11.1 release
date: 2026-06-04T09:49:56
master commit: c0ab3550eca2e9daf197c46b7e4b24aa9637cf2e
2026-06-04 09:50:05 -07:00

18 lines
591 B
Python

import sys, unittest
class TestObjCMetaSpec(unittest.TestCase):
@unittest.skipUnless(sys.platform == "darwin", "objc runtime only on macOS")
def test_classmethods_are_classmethods(self):
from tinygrad.runtime.support.objc import Spec, id_
#_classmethods_ must include classmethod descriptors
class ObjCTest(Spec):
_methods_ = [("foo", id_, [])]
_classmethods_ = [("bar", id_, [])]
self.assertNotIsInstance(ObjCTest.__dict__["foo"], classmethod)
self.assertIsInstance(ObjCTest.__dict__["bar"], classmethod)
if __name__ == "__main__":
unittest.main()