code: def test_class_members():
      class Dummy(object):
          """
          Dummy class.
  
          """
  
          def spam(self, a, b):
              """Spam\n\nSpam spam."""
              pass
  
          def ham(self, c, d):
              """Cheese\n\nNo cheese."""
              pass
  
          @property
          def spammity(self):
              """Spammity index"""
              return 0.95
  
          class Ignorable(object):
              """local class, to be ignored"""
  
              pass
  
      for cls in (ClassDoc, SphinxClassDoc):
          doc = cls(Dummy, config=dict(show_class_members=False))
          assert "Methods" not in str(doc), (cls, str(doc))
          assert "spam" not in str(doc), (cls, str(doc))
          assert "ham" not in str(doc), (cls, str(doc))
          assert "spammity" not in str(doc), (cls, str(doc))
          assert "Spammity index" not in str(doc), (cls, str(doc))
  
          doc = cls(Dummy, config=dict(show_class_members=True))
          assert "Methods" in str(doc), (cls, str(doc))
          assert "spam" in str(doc), (cls, str(doc))
          assert "ham" in str(doc), (cls, str(doc))
          assert "spammity" in str(doc), (cls, str(doc))
  
          if cls is SphinxClassDoc:
              assert ".. autosummary::" in str(doc), str(doc)
          else:
              assert "Spammity index" in str(doc), str(doc)
  
      class SubDummy(Dummy):
          """
          Subclass of Dummy class.
  
          """
  
          def ham(self, c, d):
              """Cheese\n\nNo cheese.\nOverloaded Dummy.ham"""
              pass
  
          def bar(self, a, b):
              """Bar\n\nNo bar"""
              pass
  
      for cls in (ClassDoc, SphinxClassDoc):
          doc = cls(
              SubDummy,
              config=dict(
                  show_class_members=True,
                  show_inherited_class_members=False,
              ),
          )
          assert "Methods" in str(doc), (cls, str(doc))
          assert "spam" not in str(doc), (cls, str(doc))
          assert "ham" in str(doc), (cls, str(doc))
          assert "bar" in str(doc), (cls, str(doc))
          assert "spammity" not in str(doc), (cls, str(doc))
  
          if cls is SphinxClassDoc:
              assert ".. autosummary::" in str(doc), str(doc)
          else:
              assert "Spammity index" not in str(doc), str(doc)
  
          doc = cls(
              SubDummy,
              config=dict(
                  show_class_members=True,
                  show_inherited_class_members=True,
              ),
          )
          assert "Methods" in str(doc), (cls, str(doc))
          assert "spam" in str(doc), (cls, str(doc))
          assert "ham" in str(doc), (cls, str(doc))
          assert "bar" in str(doc), (cls, str(doc))
          assert "spammity" in str(doc), (cls, str(doc))
  
          if cls is SphinxClassDoc:
              assert ".. autosummary::" in str(doc), str(doc)
          else:
              assert "Spammity index" in str(doc), str(doc)
  
imports: import sys, textwrap
  from numpydoc.docscrape import NumpyDocString, FunctionDoc, ClassDoc
  from numpydoc.docscrape_sphinx import SphinxDocString, SphinxClassDoc
  from nose.tools import *
label_desc: Use image node_id 25 for calling a global function with example usage: test_class_members() and returns: int