@@ -79,7 +79,7 @@ def test_get_object_dynamic_class_method_doc():
79
79
assert meth .docstring .value == "A dynamic method"
80
80
81
81
82
- def test_get_object_dynamic_class_method_doc ():
82
+ def test_get_object_dynamic_class_method_doc_partial ():
83
83
obj = get_object ("quartodoc.tests.example_dynamic:AClass" , dynamic = True )
84
84
85
85
meth = obj .members ["dynamic_create" ]
@@ -92,7 +92,28 @@ def test_get_object_dynamic_class_instance_attr_doc():
92
92
assert obj .members ["b" ].docstring .value == "The b attribute"
93
93
94
94
95
- def test_get_object_dynamic_class_instance_attr_doc ():
95
+ def test_get_object_dynamic_class_instance_attr_doc_class_attr_valueless ():
96
96
obj = get_object ("quartodoc.tests.example_dynamic:InstanceAttrs" , dynamic = True )
97
97
98
98
assert obj .members ["z" ].docstring .value == "The z attribute"
99
+
100
+
101
+ def test_get_object_dynamic_module_attr_str ():
102
+ # a key behavior here is that it does not error attempting to look up
103
+ # str.__module__, which does not exist
104
+ obj = get_object ("quartodoc.tests.example_dynamic:NOTE" , dynamic = True )
105
+
106
+ assert obj .name == "NOTE"
107
+
108
+ # this case is weird, but we are dynamically looking up a string
109
+ # so our __doc__ is technically str.__doc__
110
+ assert obj .docstring .value == str .__doc__
111
+
112
+
113
+ def test_get_object_dynamic_module_attr_class_instance ():
114
+ # a key behavior here is that it does not error attempting to look up
115
+ # str.__module__, which does not exist
116
+ obj = get_object ("quartodoc.tests.example_dynamic:some_instance" , dynamic = True )
117
+
118
+ assert obj .path == "quartodoc.tests.example_dynamic.some_instance"
119
+ assert obj .docstring .value == "Dynamic instance doc"
0 commit comments