@@ -212,10 +212,7 @@ def test_class(self, app):
212212 if sphinx_version [:2 ] > [3 , 1 ]:
213213 assert in_autosummary ("instance_attribute" , html )
214214 elif sphinx_version [:2 ] < [3 , 1 ]:
215- assert (
216- '<span class="pre">dummy.TestClass.instance_attribute</span>'
217- in html
218- )
215+ assert in_autosummary ("TestClass.instance_attribute" , html )
219216
220217 assert in_autosummary ("test_method" , html )
221218 assert in_autosummary ("test_attr" , html )
@@ -267,10 +264,7 @@ def test_class_order(self, app):
267264 if sphinx_version [:2 ] > [3 , 1 ]:
268265 assert in_autosummary ("instance_attribute" , html )
269266 elif sphinx_version [:2 ] < [3 , 1 ]:
270- assert (
271- '<span class="pre">dummy.TestClass.instance_attribute</span>'
272- in html
273- )
267+ assert in_autosummary ("TestClass.instance_attribute" , html )
274268
275269 assert in_autosummary ("test_attr" , html )
276270 assert in_autosummary ("large_data" , html )
@@ -287,10 +281,7 @@ def test_class_summary_only(self, app):
287281 if sphinx_version [:2 ] > [3 , 1 ]:
288282 assert in_autosummary ("instance_attribute" , html )
289283 elif sphinx_version [:2 ] < [3 , 1 ]:
290- assert (
291- '<span class="pre">dummy.TestClass.instance_attribute</span>'
292- in html
293- )
284+ assert in_autosummary ("TestClass.instance_attribute" , html )
294285
295286 assert in_autosummary ("test_method" , html )
296287 assert in_autosummary ("test_attr" , html )
@@ -314,10 +305,7 @@ def test_class_nosignatures(self, app):
314305 if sphinx_version [:2 ] > [3 , 1 ]:
315306 assert in_autosummary ("instance_attribute" , html )
316307 elif sphinx_version [:2 ] < [3 , 1 ]:
317- assert (
318- '<span class="pre">dummy.TestClass.instance_attribute</span>'
319- in html
320- )
308+ assert in_autosummary ("TestClass.instance_attribute" , html )
321309
322310 assert in_autosummary ("test_method" , html )
323311 assert in_autosummary ("test_attr" , html )
@@ -366,6 +354,28 @@ def test_autoclasssumm_inline(self, app):
366354
367355 assert docstring_end > methods_start
368356
357+ def test_class_submodule (self , app ):
358+ app .build ()
359+
360+ html = get_html (app , '/test_class_submodule.html' )
361+
362+ # check that hyperlink for instance method exists in summary table
363+ assert re .findall (r'<td>.*href="#dummy_submodule\.submodule1'
364+ r'\.SubmoduleClass1\.func1".*</td>' , html )
365+
366+ def test_module_submodule (self , app ):
367+ app .build ()
368+
369+ html = get_html (app , '/test_module_submodule.html' )
370+
371+ # check that hyperlink for class exists in summary table
372+ assert re .findall (r'<td>.*href="#dummy_submodule\.submodule2'
373+ r'\.SubmoduleClass2".*</td>' , html )
374+
375+ # check that hyperlink for instance method exists in summary table
376+ assert re .findall (r'<td>.*href="#dummy_submodule\.submodule2'
377+ r'\.SubmoduleClass2\.func2".*</td>' , html )
378+
369379
370380class TestAutoDocSummDirective :
371381 """Test case for the :class:`autodocsumm.AutoDocSummDirective`."""
0 commit comments