title: How do you create a python package with a built in "test/main.py" main function?
body: <p>Desired directory tree:</p>
  
  <pre><code>Fibo
  |-- src
  |   `-- Fibo.py
  `-- test
      `-- main.py
  </code></pre>
  
  <p>What I want is to call <code>python main.py</code> after cd'ing into test and executing main.py will run all the unit tests for this package.</p>
  
  <p>Currently if I do:</p>
  
  <pre><code>import Fibo
  
  def main():
      Fibo.fib(100)
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>I get an error: "<code>ImportError: No module named Fibo</code>".</p>
  
  <p>But if I do:</p>
  
  <pre><code>import sys
  
  def main():
      sys.path.append("/home/tsmith/svn/usefuldsp/trunk/Labs/Fibo/src")
      import Fibo
      Fibo.fib(100)
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>This seems to fix my error. And I could move forward... but this isn't a python package. This is more of a "collection of files" approach.</p>
  
  <p><strong>How would you setup your testing to work in this directory structure?</strong></p>