title: Python project directory structure / pytest trouble
body: <p>This should be the easiest problem on earth, but even after extensive searching and tinkering, I'm still in deep trouble with finding a "correct" way to lay a directory structure and manage to run pytest etc correctly.</p>
  
  <p>Let's say my I have a program called apple.</p>
  
  <pre><code>|- README.md
  |- apple
  |   |-- __init__.py
  |   |-- apple.py
  | - tests
  |   |-- test_everything.py
  </code></pre>
  
  <p>The apple.py contains some functions, for examples sake let's call one <code>eat()</code>. And the <code>test_everything.py</code> file contains some tests like <code>assert eat()=="foobar"</code>. So good so easy, but then the fun begins:</p>
  
  <ul>
  <li>What about the <code>__init__.py</code> in the apple directory... correct? Empty or what should be inside?</li>
  <li>Is it best practice to call <code>py.test</code> from the root directory? Or <code>py.test tests</code>?</li>
  <li>So many projects have a <code>__init__.py</code> in their test directory, but that's explicitly said to be wrong in the py.test documentation. So why god why</li>
  <li>What comes at the top of the <code>test_everything.py</code> file: an <code>import apple</code> or <code>from apple import *</code>? or something else entirely</li>
  <li>Do you call the functions then by <code>eat()</code> or <code>apple.eat()</code>?</li>
  <li>Some even recommend manipulating <code>os.path.dirname</code> in python</li>
  </ul>
  
  <p>This should be easy, but I've seen every combination of the above, not even speaking about tox and the myriad of other tools. Yet with the slightest error, you get thrown some <code>ImportError: No module named 'apple'</code> or some other funky error. </p>
  
  <p>What is the "right" way? The advice and the existing code on github etc follows extremely different conventions. For a medium-experienced coder, this should be much easier.</p>