title: Why is relative path not working in python tests?
body: <p>My directory layout is as follows</p>
  
  <pre><code>project\
  project\setup.py
  project\scripts\foo.py
  project\scripts\bar.py
  project\scripts\__init__.py
  project\tests\test_foo.py
  project\tests\__init__.py
  </code></pre>
  
  <p>My test file looks as follows</p>
  
  <pre><code>project\tests\test_fo.py
  
  from ..scripts import foo
  
  def test_one():
       assert 0
  </code></pre>
  
  <p>I get the following error, when I do </p>
  
  <pre><code>cd C:\project
  C:\virtualenvs\test_env\Scripts\activate
  python setup.py install
  python setup.py test
  </code></pre>
  
  <p><strong>E   ValueError: Attempted relative import beyond toplevel package</strong></p>
  
  <p>What am I doing wrong? 
  This is my setup.py</p>
  
  <pre><code>setup(
      name = 'project',
      setup_requires=['pytest-runner'],
      tests_require=['pytest'],
      packages = ["scripts","tests"],
      package_data={
            'scripts': ['*.py'],
            'tests': ['*.py'],
           },
  )
  </code></pre>