title: How to exclude pytest test_* functions from Sphinx autodoc?
body: <p>I have multiple modules in my <code>package</code>.</p>
  
  <pre><code>package/
  |--mod1.py
  |--mod2.py
  </code></pre>
  
  <p>Each module contains some <code>functions</code> and a <code>test_function</code> for testing the module.</p>
  
  <p>I am using <code>sphinx-apidoc</code> to generate the <code>.rst</code> files for every <code>module</code> in <code>package</code>. My problem is that when I am generating documentation for my package, the <code>test</code> functions are also getting included in the documentation. I know it is possible to skip functions by using: <code>:exclude members: function</code>. But I'm looking for a solution that will allow me to do that for all modules by using a pattern similar to <code>test_*</code>.</p>
  
  <p>My <code>package.rst</code> file looks like this:</p>
  
  <pre><code>package package
  ===============
  
  Submodules
  ----------
  
  .. toctree::
  
     package.mod1
     package.mod2
  
  Module contents
  ---------------
  
  .. automodule:: package
      :members:
      :undoc-members:
      :show-inheritance:
  </code></pre>
  
  <p>And my <code>mod1.rst</code> file looks like this:</p>
  
  <pre><code>package.mod1 module
  ===================
  
  .. automodule:: package.mod1
      :members:
      :undoc-members:
      :show-inheritance:
  </code></pre>
  
  <p>Thanks in advance.</p>