When using PyCharm to launch my tests I have no import problems at all, but if I do it in the terminal pytest complains about modules that cannot find. Precisely those under `tests/tools`.

Project folder structure:

```
src/
    app/

tests/
    end_to_end/ # End to end/Acceptance tests
    tools/      # Helper modules used by some tests
    unit        # Unit tests

setup.py

```

Relevant parts of `setup.py`:

```
setup(...
      packages=find_packages('src'),
      package_dir={'': 'src'},
      install_requires=['requests'],
      test_suite='tests',
      tests_require=[
          'flexmock',
          'pytest',
          'wsgi_intercept'
      ])

```

Import line that fails when executing `py.test tests/end_to_end`, no matter if the virtualenv is active or not. Modules imported from the `app` package are fine:

```
from tests.tools.foomodule import Foo # Fails
from app.barmodule import Bar         # Doesn't fail

```

I had to install my package with `pip install -e packagename` in order to be *available* for pytest when running tests from the command line. I suppose I will have to add the `tools` folder as a package in my `setup.py`, but this feels ugly to me because that modules are only for aiding in the testing process and aren't meant to be distributed.

On the other hand I could launch my tests with `python setup.py test` following the [integration advices from pytest website](https://pytest.org/latest/goodpractises.html#integrating-with-distutils-python-setup-py-test).