title: Python unit test that uses an external data file
body: <p>I have a Python project that I'm working on in Eclipse and I have the following file structure:</p>
  
  <pre><code>/Project
      /projectname
          module1.py
          module2.py 
          # etc.
      /test
          testModule1.py
          # etc.
          testdata.csv
  </code></pre>
  
  <p>In one of my tests I create an instance of one of my classes giving <code>'testdata.csv'</code> as a parameter. This object does <code>open('testdata.csv')</code> and reads the contents. </p>
  
  <p>If I run just this single test file with <code>unittest</code> everything works and the file is found and read properly. However if I try to run all my unit tests (i.e. run by right clicking the <code>test</code> directory rather than the individual test file), I get an error that file could not be found.</p>
  
  <p>Is there any way to get around this (other than providing an absolute path, which I'd prefer not to do)?</p>