title: Bootstrapping tests and using Python test discovery
body: <p>A problem I continue to have it "bootstrapping" my tests.</p>
  
  <p>The problem that I have is exactly <a href="https://stackoverflow.com/questions/1896918/running-unittest-with-typical-test-directory-structure">what this guy has</a>.</p>
  
  <p>The top solution talks about creating a "boostrap" script.  I presume that I must then enumerate all of the tests to be run, or use test manifests in the <code>__init__.py</code> files using the <code>__all__</code> keyword.  However, I noticed that the <a href="http://docs.python.org/library/unittest.html" rel="nofollow noreferrer">most recent Python documentation on unittest</a> does not talk about <code>__all__</code> anymore.  </p>
  
  <p>In 2.7, we have the python command called "discovery"</p>
  
  <pre><code>python -m unittest discover
  </code></pre>
  
  <p>That works even nicer.  Because:
  1) There's no need for Nose
  2) There's no need for test manifests</p>
  
  <p>But it doesn't seem to have a way to "bootstrap"</p>
  
  <p>Do I need to use another test runner?  One that allows bootstrapping AND discovery?</p>
  
  <p>Do I need py.test?<br>
  <a href="http://pytest.org/" rel="nofollow noreferrer">http://pytest.org/</a></p>
  
  <p>The reason that I need bootstrapping, is the problem that <a href="https://stackoverflow.com/questions/1896918/running-unittest-with-typical-test-directory-structure">this guy has</a>. Basically, my import statements don't work right if I run the test directly.  I want to execute my suite of tests from the top of my project, just like the app would when it runs normally.  </p>
  
  <p>After all, import statements are always relative to their physical location. (BTW, I think this is a hindrance in Python)  </p>
  
  <p><strong>Definition: What is Bootstrapping?</strong>
  Bootstrapping means that I want to do some setup before running any tests at all in the entire project.  This is sort of like me asking for a "test setup" at the whole project level. </p>
  
  <p><strong>Update</strong>
  <a href="https://stackoverflow.com/questions/3295386/python-unittest-and-discovery">Here is another posting about the same thing</a>.  Using this 2.7 command, we can avoid Nose. But how does one add bootstrapping?</p>