title: Why does import work with Python nose when test directory contains __init__.py?
body: <p>Consider the following project structure:</p>
  
  <pre><code>a.py
  test/
    test_a.py
  </code></pre>
  
  <p>with <code>test_a.py</code> importing module <code>a</code>:</p>
  
  <pre><code>import a
  </code></pre>
  
  <p>As expected, running <code>nosetests</code> in the <code>test</code> directory results in import error:</p>
  
  <pre><code>ERROR: Failure: ImportError (No module named a)
  </code></pre>
  
  <p>However, I noticed that adding an empty <code>__init__.py</code> file to the <code>test</code> directory makes import work with <code>nosetests</code> (but not when you run <code>test_a.py</code> with Python). Could you explain why?</p>
  
  <p>I understand that adding <code>__init__.py</code> makes <code>test</code> a package. But does it mean that import includes the directory containing the package in the lookup?</p>