This is an automated email from the ASF dual-hosted git repository. tqchen pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tvm-ffi.git
The following commit(s) were added to refs/heads/main by this push: new 9b3be5d test: `__doc__` being None when it's not explicitly set (#61) 9b3be5d is described below commit 9b3be5d12df257bef9a75e46ae8086b55b8cad49 Author: Junru Shao <junrus...@apache.org> AuthorDate: Fri Sep 26 15:19:01 2025 -0700 test: `__doc__` being None when it's not explicitly set (#61) Additional test of #60 --- tests/python/test_object.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/python/test_object.py b/tests/python/test_object.py index ee5dc4e..f679469 100644 --- a/tests/python/test_object.py +++ b/tests/python/test_object.py @@ -53,6 +53,15 @@ def test_attribute() -> None: assert type(obj).b.__doc__ == "Field `b`" +def test_attribute_no_doc() -> None: + from tvm_ffi.testing import TestObjectBase # noqa: PLC0415 + + # The docs for v_f64 and v_str are None because they are not explicitly set. + assert TestObjectBase.v_i64.__doc__ == "i64 field" + assert TestObjectBase.v_f64.__doc__ is None + assert TestObjectBase.v_str.__doc__ is None + + def test_setter() -> None: # test setter obj0 = tvm_ffi.testing.create_object("testing.TestObjectBase", v_i64=10, v_str="hello")