@@ -185,6 +185,22 @@ def test_module_with_title(self, app, status, warning):
185185 else :
186186 self .assertNotIn ('Should also be skipped' , html )
187187
188+ @with_app (buildername = 'html' , srcdir = sphinx_supp ,
189+ copy_srcdir_to_tmpdir = True )
190+ def test_module_nosignatures (self , app , status , warning ):
191+ app .build ()
192+
193+ html = get_html (app , 'test_module_nosignatures.html' )
194+ self .assertIn ('<span class="pre">TestClass</span>' , html )
195+ self .assertIn ('<span class="pre">test_func</span>' , html )
196+
197+ # test whether the data is shown correctly
198+ self .assertIn ('<span class="pre">large_data</span>' , html )
199+ self .assertIn ('<span class="pre">small_data</span>' , html )
200+
201+ self .assertNotIn ('<dt id="dummy.Class_CallTest">' , html )
202+ self .assertNotIn ('()' , html )
203+
188204 @with_app (buildername = 'html' , srcdir = sphinx_supp ,
189205 copy_srcdir_to_tmpdir = True )
190206 def test_class (self , app , status , warning ):
@@ -291,6 +307,34 @@ def test_class_summary_only(self, app, status, warning):
291307
292308 self .assertNotIn ('<dt id="dummy.TestClass.small_data">' , html )
293309
310+ @with_app (buildername = 'html' , srcdir = sphinx_supp ,
311+ copy_srcdir_to_tmpdir = True )
312+ def test_class_nosignatures (self , app , status , warning ):
313+ app .build ()
314+ html = get_html (app , '/test_class_nosignatures.html' )
315+
316+ if sphinx_version [:2 ] > [3 , 1 ]:
317+ self .assertIn (
318+ '<span class="pre">instance_attribute</span>' ,
319+ html )
320+ elif sphinx_version [:2 ] < [3 , 1 ]:
321+ self .assertIn (
322+ '<span class="pre">dummy.TestClass.instance_attribute</span>' ,
323+ html )
324+
325+ self .assertIn ('<span class="pre">test_method</span>' , html )
326+ self .assertIn ('<span class="pre">test_attr</span>' , html )
327+
328+ # test whether the right objects are included
329+ self .assertIn ('<span class="pre">class_caller</span>' , html )
330+
331+ # test whether the data is shown correctly
332+ self .assertIn ('<span class="pre">large_data</span>' , html )
333+ self .assertIn ('<span class="pre">small_data</span>' , html )
334+
335+ self .assertNotIn ('<dt id="dummy.TestClass.small_data">' , html )
336+ self .assertNotIn ('()' , html )
337+
294338 @with_app (buildername = 'html' , srcdir = sphinx_supp ,
295339 copy_srcdir_to_tmpdir = True )
296340 def test_inherited (self , app , status , warning ):
@@ -381,6 +425,23 @@ def test_autoclasssumm_some_sections(self, app, status, warning):
381425 self .assertIn ('<span class="pre">class_caller</span>' , html )
382426 self .assertIn ('<span class="pre">test_attr</span>' , html )
383427
428+ @with_app (buildername = 'html' , srcdir = sphinx_supp ,
429+ copy_srcdir_to_tmpdir = True )
430+ def test_autoclasssumm_nosignatures (self , app , status , warning ):
431+ """Test building the autosummary of a class without signatures."""
432+ app .build ()
433+
434+ html = get_html (app , '/test_autoclasssumm_nosignatures.html' )
435+
436+ # the class docstring must not be in the html
437+ self .assertNotIn ("Class test for autosummary" , html )
438+
439+ # test if the methods and attributes are there in a table
440+ self .assertIn ('<span class="pre">test_method</span>' , html )
441+ self .assertIn ('<span class="pre">test_attr</span>' , html )
442+
443+ self .assertNotIn ('()' , html )
444+
384445 @with_app (buildername = 'html' , srcdir = sphinx_supp ,
385446 copy_srcdir_to_tmpdir = True )
386447 def test_automodulesumm (self , app , status , warning ):
@@ -413,6 +474,24 @@ def test_automodulesumm_some_sections(self, app, status, warning):
413474 self .assertIn ('<span class="pre">large_data</span>' , html )
414475 self .assertIn ('<span class="pre">test_func</span>' , html )
415476
477+ @with_app (buildername = 'html' , srcdir = sphinx_supp ,
478+ copy_srcdir_to_tmpdir = True )
479+ def test_automodulesumm_nosignatures (self , app , status , warning ):
480+ """Test building the autosummary of a module without signatures."""
481+ app .build ()
482+
483+ html = get_html (app , '/test_automodulesumm_nosignatures.html' )
484+
485+ # the class docstring must not be in the html
486+ self .assertNotIn ("Module for testing the autodocsumm" , html )
487+
488+ # test if the classes, data and functions are there in a table
489+ self .assertIn ('<span class="pre">Class_CallTest</span>' , html )
490+ self .assertIn ('<span class="pre">large_data</span>' , html )
491+ self .assertIn ('<span class="pre">test_func</span>' , html )
492+
493+ self .assertNotIn ('()' , html )
494+
416495 @with_app (buildername = 'html' , srcdir = sphinx_supp ,
417496 copy_srcdir_to_tmpdir = True )
418497 def test_empty (self , app , status , warning ):
0 commit comments