title: Cant run tests with pytest, module not found
body: <p>I have a directory structured like this:</p>
  
  <pre><code>| project/
  | ---- lib/
  | -------- __init__.py
  | -------- MyModule.py
  | ---- test/
  | -------- __init__.py
  | -------- test_MyModule.py
  | ---- __init__.py
  </code></pre>
  
  <p>in my test file i do the following:</p>
  
  <pre><code>from project.lib.MyModule import MyModule
  </code></pre>
  
  <p>This is the text of MyModule:</p>
  
  <pre><code>class MyModule(object):
      pass
  </code></pre>
  
  <p>I'm able to run this both in the console and from a file. But for some reason pytest is not able to discover <code>MyModule</code>. I get an error saying:</p>
  
  <pre><code>E   ImportError: No module named 'project'
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've tried this too and failed:</p>
  
  <pre><code>import sys
  sys.path.insert(0, "~/project")
  </code></pre>
  
  <p>Doesnt work. Help.</p>