title: Python Travis-CI: Importing main code in test code
body: <p>I am writing a simple package in python. In the root directory, my structure currently is,</p>
  
  <ul>
  <li>my_package<br>
  
  <ul>
  <li><strong>init</strong>.py</li>
  <li>main_code.py</li>
  </ul></li>
  <li>tests
  
  <ul>
  <li><strong>init</strong>.py</li>
  <li>test_main_code.py</li>
  </ul></li>
  </ul>
  
  <p>I want to import all functions from  main_code.py in test_main_code.py. To achieve this, I did<br></p>
  
  <pre><code>import sys
  import os
  sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '\..' + '\my_package')
  from main_code import *
  </code></pre>
  
  <p>This runs smoothly on my system. But when I push the code to github and tests are run on travis-ci, all tests fail and return NameError. It says given function name not defined. How do I make sure that tests run on travis-ci as well ?</p>